[Bug c/64610] No -Wbool-compare warning on "(0 != a) >= 0"

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 29 18:14:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64610

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Wed Apr 29 18:13:44 2015
New Revision: 222587

URL: https://gcc.gnu.org/viewcvs?rev=222587&root=gcc&view=rev
Log:
        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.

Added:
    trunk/gcc/testsuite/c-c++-common/Wbool-compare-2.c
Modified:
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/c-c++-common/Wbool-compare-1.c



More information about the Gcc-bugs mailing list