[Bug c/77292] Spurious "warning: logical not is only applied to the left hand side of comparison"

2016-08-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77292 Richard Biener changed: What|Removed |Added Keywords||diagnostic --- Comment #1 from Richard

[Bug c/77292] Spurious "warning: logical not is only applied to the left hand side of comparison"

2016-08-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77292 Marek Polacek changed: What|Removed |Added CC||mpolacek at gcc dot gnu.org --- Comment

[Bug c/77292] Spurious "warning: logical not is only applied to the left hand side of comparison"

2016-08-19 Thread terra at gnome dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77292 --- Comment #3 from M Welinder --- The actual code I got this warning from was... if (!lower_tail == (p > phalf)) { where lower_tail is an int and p and phalf are doubles. That's simply a comparison of two booleans. Note, that

[Bug c/77292] Spurious warning: logical not is only applied to the left hand side of comparison

2016-08-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77292 Richard Biener changed: What|Removed |Added Status|SUSPENDED |NEW Summary|value range prop

[Bug c/77292] Spurious warning: logical not is only applied to the left hand side of comparison

2016-08-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77292 --- Comment #8 from Marek Polacek --- Neither does cc1plus because comparison result has a boolean type... I'll see what I can do here.

[Bug c/77292] Spurious warning: logical not is only applied to the left hand side of comparison

2016-08-19 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77292 --- Comment #9 from Manuel López-Ibáñez --- (In reply to M Welinder from comment #3) > I am not aware of a rule that requires the compiler to ignore context > when considering warnings. It certainly does consider context when > it issues "might

[Bug c/77292] Spurious warning: logical not is only applied to the left hand side of comparison

2016-08-19 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77292 --- Comment #10 from Manuel López-Ibáñez --- (In reply to Richard Biener from comment #5) > int > foo (int a, int b) > { > return !a == (a < b); > } > > t.c: In function ‘foo’: > t.c:4:13: warning: logical not is only applied to the left hand

[Bug c/77292] Spurious warning: logical not is only applied to the left hand side of comparison

2016-08-19 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77292 Segher Boessenkool changed: What|Removed |Added CC||segher at gcc dot gnu.org --- Comme

[Bug c/77292] Spurious warning: logical not is only applied to the left hand side of comparison

2016-08-19 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77292 --- Comment #12 from Manuel López-Ibáñez --- (In reply to Segher Boessenkool from comment #11) > Both of these suggestions are not so good. "!(a == b)" is better written > as "a != b", and "!(a) == b" is just horrible. Agreed for the former, bu

[Bug c/77292] Spurious warning: logical not is only applied to the left hand side of comparison

2016-08-19 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77292 --- Comment #13 from Segher Boessenkool --- (In reply to Manuel López-Ibáñez from comment #12) > (In reply to Segher Boessenkool from comment #11) > > Both of these suggestions are not so good. "!(a == b)" is better written > > as "a != b", and

[Bug c/77292] Spurious warning: logical not is only applied to the left hand side of comparison

2016-08-24 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77292 --- Comment #14 from Manuel López-Ibáñez --- (In reply to Manuel López-Ibáñez from comment #10) > > t.c:4:13: warning: logical not is only applied to the left hand side of > > comparison [-Wlogical-not-parentheses] > >return !a == (a < b); >

[Bug c/77292] Spurious warning: logical not is only applied to the left hand side of comparison

2016-08-29 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77292 --- Comment #15 from Marek Polacek --- Author: mpolacek Date: Mon Aug 29 18:13:13 2016 New Revision: 239833 URL: https://gcc.gnu.org/viewcvs?rev=239833&root=gcc&view=rev Log: PR c/77292 * c-common.c (warn_logical_not_parentheses)

[Bug c/77292] Spurious warning: logical not is only applied to the left hand side of comparison

2016-08-29 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77292 Marek Polacek changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---