This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Add -Wduplicated-cond
- From: Tom Tromey <tromey at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 7 May 2018 14:54:47 -0000
- Subject: [binutils-gdb] Add -Wduplicated-cond
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=aff689d36d66dd45a59008f3778d3d22e3cfcb9b
commit aff689d36d66dd45a59008f3778d3d22e3cfcb9b
Author: Tom Tromey <tom@tromey.com>
Date: Sat Apr 21 12:00:29 2018 -0600
Add -Wduplicated-cond
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.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/configure | 3 ++-
gdb/gdbserver/ChangeLog | 4 ++++
gdb/gdbserver/configure | 3 ++-
gdb/warning.m4 | 3 ++-
5 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 89c55f6..2c32f94 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/configure b/gdb/configure
index 96dd9fa..0eec780 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -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*)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index f1dd1dd..7461359 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,7 @@
+2018-05-07 Tom Tromey <tom@tromey.com>
+
+ * configure: Rebuild.
+
2018-05-04 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 919ed31..ac61ba3 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -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*)
diff --git a/gdb/warning.m4 b/gdb/warning.m4
index 1cc3c68..cb23472 100644
--- a/gdb/warning.m4
+++ b/gdb/warning.m4
@@ -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*)