[binutils-gdb] Add -Wduplicated-cond

sergiodj+buildbot@sergiodj.net sergiodj+buildbot@sergiodj.net
Mon May 7 16:17:00 GMT 2018


*** TEST RESULTS FOR COMMIT aff689d36d66dd45a59008f3778d3d22e3cfcb9b ***

Author: Tom Tromey <tom@tromey.com>
Branch: master
Commit: aff689d36d66dd45a59008f3778d3d22e3cfcb9b

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.



More information about the Gdb-testers mailing list