* c-common.c (maybe_warn_bool_compare): When comparing with 0/1,
commit14744a165c6b584688a15158d07a65e41cac01c6
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 30 Apr 2015 13:20:03 +0000 (30 13:20 +0000)
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 30 Apr 2015 13:20:03 +0000 (30 13:20 +0000)
tree542480c9b7ef2c43959ef8a34b1d4b686702590a
parentd08a3f89698ea4e70b8213191a87fd76ca362efe
* c-common.c (maybe_warn_bool_compare): When comparing with 0/1,
require that the non-constant be of a boolean type.

* c-c++-common/Wbool-compare-3.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222622 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wbool-compare-3.c [new file with mode: 0644]