[Bug c/49706] No warning for (!x > 1) which is always false

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jun 5 06:20:00 GMT 2014


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

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Thu Jun  5 06:20:05 2014
New Revision: 211255

URL: http://gcc.gnu.org/viewcvs?rev=211255&root=gcc&view=rev
Log:
    PR c/49706
    * doc/invoke.texi: Document -Wlogical-not-parentheses.
c-family/
    * c-common.c (warn_logical_not_parentheses): New function.
    * c-common.h (warn_logical_not_parentheses): Declare.
    * c.opt (Wlogical-not-parentheses): New option.
c/
    * c-typeck.c (parser_build_binary_op): Warn when logical not is used
    on the left hand side operand of a comparison. 
cp/
    * parser.c (cp_parser_binary_expression): Warn when logical not is
    used on the left hand side operand of a comparison.
testsuite/
    * c-c++-common/pr49706.c: New test.

Added:
    trunk/gcc/testsuite/c-c++-common/pr49706.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/c-family/c-common.h
    trunk/gcc/c-family/c.opt
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-typeck.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/doc/invoke.texi
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-bugs mailing list