Enable -Wpointer-sign by default.
authorPedro Alves <palves@redhat.com>
Fri, 19 Apr 2013 18:32:54 +0000 (18:32 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 19 Apr 2013 18:32:54 +0000 (18:32 +0000)
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  <palves@redhat.com>

* configure.ac (build_warnings): Replace -Wno-pointer-sign with
-Wpointer-sign.
* configure: Regenerate.

gdb/doc
2013-04-19  Pedro Alves  <palves@redhat.com>

* gdbint.texinfo (Misc Guidelines) <Compiler Warnings>: Replace
-Wno-pointer-sign text with text on -Wpointer-sign.

gdb/ChangeLog
gdb/configure
gdb/configure.ac
gdb/doc/ChangeLog
gdb/doc/gdbint.texinfo

index e795950d6c0910b7704ae13452d7d4e93b417f9b..5a2c3233dad17cc59678c97cb07153b833466846 100644 (file)
@@ -1,3 +1,9 @@
+2013-04-19  Pedro Alves  <palves@redhat.com>
+
+       * configure.ac (build_warnings): Replace -Wno-pointer-sign with
+       -Wpointer-sign.
+       * configure: Regenerate.
+
 2013-04-19  Pedro Alves  <palves@redhat.com>
 
        * ser-tcp.c (net_read_prim): Cast second argument to recv to
index f9d9a1745b4d97170d19694426eac1b888c91840..c8f3f1f55b7293f554584ce58deed323663e8cf8 100755 (executable)
@@ -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"
index ce6fa7a8a7e6a553fc95e7e8293ac2fb7964e405..884b40ebb195d7daf1b0c93c544877213cef4afc 100644 (file)
@@ -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"
index bc7eaf483057eda55fcc5987368e113d615486c8..8d6cb969413ff3de70bfea2c5c9dab9a7fb9b000 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-19  Pedro Alves  <palves@redhat.com>
+
+       * gdbint.texinfo (Misc Guidelines) <Compiler Warnings>: Replace
+       -Wno-pointer-sign text with text on -Wpointer-sign.
+
 2013-04-16  Tom Tromey  <tromey@redhat.com>
 
        * gdb.texinfo (Set Catchpoints): Mention earliest version of
index 4a75c26c59113f60fc31c83283edf45b72fae44c..34e75e209443502ae1e8b35f01e331737b91c930 100644 (file)
@@ -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 defaults.
 
 @item -Wno-unused-parameter
 Due to the way that @value{GDBN} is implemented many functions have