c-common.c (maybe_warn_bool_compare): When comparing with 0/1, require that the non...
authorMarek Polacek <polacek@redhat.com>
Thu, 30 Apr 2015 13:20:03 +0000 (13:20 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 30 Apr 2015 13:20:03 +0000 (13:20 +0000)
commit577cd070845fb8facf0a451aafe1e444b9374b08
tree542480c9b7ef2c43959ef8a34b1d4b686702590a
parentbb83a43d6b768886ea4733ca6218f30d90ea0e15
c-common.c (maybe_warn_bool_compare): When comparing with 0/1, require that the non-constant be of a boolean type.

* 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.

From-SVN: r222622
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]