Add -Wduplicated-cond
authorTom Tromey <tom@tromey.com>
Sat, 21 Apr 2018 18:00:29 +0000 (12:00 -0600)
committerTom Tromey <tom@tromey.com>
Mon, 7 May 2018 14:47:38 +0000 (08:47 -0600)
This adds -Wduplicated-cond to warnings.m4.  This caught one bug.

I tried adding -Wduplicated-branches as well, but it results in some
spurious failures from code like this in cgen.h:

    #define CGEN_ATTR_TYPE(n) \
    struct { unsigned int bool_; \
     CGEN_ATTR_VALUE_TYPE nonbool[(n) ? (n) : 1]; }

This will trigger a warning if passed n==1, which seems like a
perfectly valid thing to do; and there were other issues like this as
well.

ChangeLog
2018-05-07  Tom Tromey  <tom@tromey.com>

* configure: Rebuild.
* warning.m4 (AM_GDB_WARNINGS): Add -Wduplicated-cond.

gdbserver/ChangeLog
2018-05-07  Tom Tromey  <tom@tromey.com>

* configure: Rebuild.

gdb/ChangeLog
gdb/configure
gdb/gdbserver/ChangeLog
gdb/gdbserver/configure
gdb/warning.m4

index 89c55f6..2c32f94 100644 (file)
@@ -1,5 +1,10 @@
 2018-05-07  Tom Tromey  <tom@tromey.com>
 
+       * configure: Rebuild.
+       * warning.m4 (AM_GDB_WARNINGS): Add -Wduplicated-cond.
+
+2018-05-07  Tom Tromey  <tom@tromey.com>
+
        PR tdep/20362:
        * arm-tdep.c (arm_record_vfp_data_proc_insn): Properly mask off D
        bit.  Use correct value for VDIV.
index 96dd9fa..0eec780 100755 (executable)
@@ -15367,7 +15367,8 @@ build_warnings="-Wall -Wpointer-arith \
 -Wno-mismatched-tags \
 -Wno-error=deprecated-register \
 -Wsuggest-override \
--Wimplicit-fallthrough"
+-Wimplicit-fallthrough \
+-Wduplicated-cond"
 
 case "${host}" in
   *-*-mingw32*)
index f1dd1dd..7461359 100644 (file)
@@ -1,3 +1,7 @@
+2018-05-07  Tom Tromey  <tom@tromey.com>
+
+       * configure: Rebuild.
+
 2018-05-04  Tom Tromey  <tom@tromey.com>
 
        * configure: Rebuild.
index 919ed31..ac61ba3 100755 (executable)
@@ -7174,7 +7174,8 @@ build_warnings="-Wall -Wpointer-arith \
 -Wno-mismatched-tags \
 -Wno-error=deprecated-register \
 -Wsuggest-override \
--Wimplicit-fallthrough"
+-Wimplicit-fallthrough \
+-Wduplicated-cond"
 
 case "${host}" in
   *-*-mingw32*)
index 1cc3c68..cb23472 100644 (file)
@@ -44,7 +44,8 @@ build_warnings="-Wall -Wpointer-arith \
 -Wno-mismatched-tags \
 -Wno-error=deprecated-register \
 -Wsuggest-override \
--Wimplicit-fallthrough"
+-Wimplicit-fallthrough \
+-Wduplicated-cond"
 
 case "${host}" in
   *-*-mingw32*)