From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16604 invoked by alias); 19 Apr 2013 17:59:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 16594 invoked by uid 89); 19 Apr 2013 17:59:35 -0000 X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 19 Apr 2013 17:59:34 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3JHxXe3030181 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 19 Apr 2013 13:59:33 -0400 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3JHxWaw001953 for ; Fri, 19 Apr 2013 13:59:33 -0400 Subject: [RFA PATCH] Enable -Wpointer-sign by default. To: gdb-patches@sourceware.org From: Pedro Alves Date: Sat, 20 Apr 2013 07:04:00 -0000 Message-ID: <20130419175932.13401.30699.stgit@brno.lan> User-Agent: StGit/0.16 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-SW-Source: 2013-04/txt/msg00625.txt.bz2 This enables -Wpointer-sign by default. I've checked that --enable-targets=all builds fine with the following as --host, on x86_64 Fedora 17 --build: x86_64 GNU/Linux i386 GNU/Linux i386 MinGW-w64 i386 msdos/djgpp OK? gdb/ 2013-04-19 Pedro Alves * configure.ac (build_warnings): Replace -Wno-pointer-sign with -Wpointer-sign. * configure: Regenerate. gdb/doc 2013-04-19 Pedro Alves * gdbint.texinfo (Misc Guidelines) : Replace -Wno-pointer-sign text with text on -Wpointer-sign. --- gdb/configure | 2 +- gdb/configure.ac | 2 +- gdb/doc/gdbint.texinfo | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/gdb/configure b/gdb/configure index f9d9a17..c8f3f1f 100755 --- a/gdb/configure +++ b/gdb/configure @@ -12452,7 +12452,7 @@ fi # NOTE: If you change this list, remember to update # gdb/doc/gdbint.texinfo. build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ --Wformat-nonliteral -Wno-pointer-sign \ +-Wformat-nonliteral -Wpointer-sign \ -Wno-unused -Wunused-value -Wunused-function \ -Wno-switch -Wno-char-subscripts -Wmissing-prototypes \ -Wdeclaration-after-statement -Wempty-body" diff --git a/gdb/configure.ac b/gdb/configure.ac index ce6fa7a..884b40e 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1925,7 +1925,7 @@ fi # NOTE: If you change this list, remember to update # gdb/doc/gdbint.texinfo. build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ --Wformat-nonliteral -Wno-pointer-sign \ +-Wformat-nonliteral -Wpointer-sign \ -Wno-unused -Wunused-value -Wunused-function \ -Wno-switch -Wno-char-subscripts -Wmissing-prototypes \ -Wdeclaration-after-statement -Wempty-body" diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 4a75c26..280a860 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -6339,13 +6339,12 @@ Since @value{GDBN} uses the @code{format printf} attribute on all @code{printf} like functions this checks not just @code{printf} calls but also calls to functions such as @code{fprintf_unfiltered}. -@item -Wno-pointer-sign -In version 4.0, GCC began warning about pointer argument passing or -assignment even when the source and destination differed only in -signedness. However, most @value{GDBN} code doesn't distinguish -carefully between @code{char} and @code{unsigned char}. In early 2006 -the @value{GDBN} developers decided correcting these warnings wasn't -worth the time it would take. +@item -Wpointer-sign +This helps make sure @value{GDBN} code uses @code{gdb_byte} which is +really @code{unsigned char} for raw bytes instead of @code{char}, +whose signness is host-dependent. @sc{gcc} enables this with +@code{-Wall} since version 4.0. We enable it explicitly too to be +decoupled from future @sc{gcc} (or other compiler)'s choices. @item -Wno-unused-parameter Due to the way that @value{GDBN} is implemented many functions have