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

2022-01-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49706

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|5.5 |---

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

2019-08-17 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49706

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=49474

--- Comment #11 from Eric Gallager  ---
(In reply to Marek Polacek from comment #6)
> -Wlogical-not-parentheses is in, but I'm not marking this as fixed yet as we
> don't warn for #c2.  Maybe I will look at it, but unassigning for now.

What flag should the case in comment 2 go under? -Wtype-limits? -Wbool-compare?
-Wtautological-compare? Something else?

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

2016-06-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49706

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|5.4 |5.5

--- Comment #10 from Richard Biener  ---
GCC 5.4 is being released, adjusting target milestone.

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

2015-12-04 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49706

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|5.3 |5.4

--- Comment #9 from Richard Biener  ---
GCC 5.3 is being released, adjusting target milestone.

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

2015-07-16 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49706

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|5.2 |5.3

--- Comment #8 from Richard Biener rguenth at gcc dot gnu.org ---
GCC 5.2 is being released, adjusting target milestone to 5.3.


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

2015-04-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49706

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|5.0 |5.2

--- Comment #7 from Jakub Jelinek jakub at gcc dot gnu.org ---
GCC 5.1 has been released.


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

2014-09-01 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49706
Bug 49706 depends on bug 61271, which changed state.

Bug 61271 Summary: 10 * possible coding error with logical not (!)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61271

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED


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

2014-06-05 Thread mpolacek at gcc dot gnu.org
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=211255root=gccview=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


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

2014-06-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49706

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|NEW
   Assignee|mpolacek at gcc dot gnu.org|unassigned at gcc dot 
gnu.org

--- Comment #6 from Marek Polacek mpolacek at gcc dot gnu.org ---
-Wlogical-not-parentheses is in, but I'm not marking this as fixed yet as we
don't warn for #c2.  Maybe I will look at it, but unassigning for now.


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

2014-06-01 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49706

Andrew Pinski pinskia at gcc dot gnu.org changed:

   What|Removed |Added

 CC||manu at gcc dot gnu.org

--- Comment #3 from Andrew Pinski pinskia at gcc dot gnu.org ---
*** Bug 61276 has been marked as a duplicate of this bug. ***


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

2014-06-01 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49706

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||mpolacek at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
   Target Milestone|--- |4.10.0

--- Comment #4 from Marek Polacek mpolacek at gcc dot gnu.org ---
I have a patch implementing -Wlogical-not-parentheses.


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

2011-07-12 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49706

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||diagnostic
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2011.07.12 08:51:27
 Ever Confirmed|0   |1
   Severity|normal  |enhancement

--- Comment #1 from Richard Guenther rguenth at gcc dot gnu.org 2011-07-12 
08:51:27 UTC ---
Confirmed.


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

2011-07-12 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49706

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek jakub at gcc dot gnu.org 2011-07-12 
09:27:38 UTC ---
-Wtype-limits is apparently just in shorten_compare and vrp, while here it is
optimized by fold.  For
_Bool x;
...
if (x  1)
or
struct { unsigned int i : 1; } x;
...
if (x.i  1)
we don't warn either.