re PR c/64610 (No -Wbool-compare warning on "(0 != a) >= 0")
authorMarek Polacek <polacek@redhat.com>
Wed, 29 Apr 2015 18:13:44 +0000 (18:13 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 29 Apr 2015 18:13:44 +0000 (18:13 +0000)
commit716c0ba6bf36efd36fff564f42f1b121720cc611
treed5c027f5f606e767bd8f9c756a29ad3c77ae1274
parentd28ad5d4c5454c0a2ca24d6dcbbc9b2da5c0aaf2
re PR c/64610 (No -Wbool-compare warning on "(0 != a) >= 0")

PR c/64610
* c-common.c (maybe_warn_bool_compare): Warn when comparing a boolean
with 0/1.

* c-c++-common/Wbool-compare-1.c (fn1): Remove a few lines.
* c-c++-common/Wbool-compare-2.c: New test.

From-SVN: r222587
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wbool-compare-1.c
gcc/testsuite/c-c++-common/Wbool-compare-2.c [new file with mode: 0644]