]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/c-family/c.opt
re PR c/49706 (No warning for (!x > 1) which is always false)
authorMarek Polacek <polacek@redhat.com>
Thu, 5 Jun 2014 06:20:05 +0000 (06:20 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 5 Jun 2014 06:20:05 +0000 (06:20 +0000)
commit742938c911864563a8b04b95cbcf53d8f12a4ef9
tree10c8e02d49aad0155082bdf3d7725c4ee7041702
parent6447c55dea95705018ff2bb3de7a81c160a71d4e
re PR c/49706 (No warning for (!x > 1) which is always false)

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.

From-SVN: r211255
12 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c-family/c.opt
gcc/c/ChangeLog
gcc/c/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr49706.c [new file with mode: 0644]