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 89c55f6d0cbc6f8598528a3c6829710aa5f20ba6..2c32f9464cf9aa3317487bd7b562356441003d6f 100644 (file)
@@ -1,3 +1,8 @@
+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:
index 96dd9fa73243a7138576bd65129536ab6696d59a..0eec780bd16acdbccc91a5076acba592dfece3e3 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 f1dd1ddc9774ec7a8ac302fd5235da0452e18eeb..74613598a282a97dbc74e65fe09dcae19ee86385 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 919ed316653d6e6f4cfa7cd6779db34f29f5ec6d..ac61ba3543fecf199338c71087ed02000edcb211 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 1cc3c6839854605cf4a554670e7c0f7010048c35..cb23472ec6caef8e9a269b5c01cb3211f80b7fb1 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*)