[Bug c/65120] New: [gcc5] Wlogical-not-parentheses should not wanr about double exclamation !!
jirislaby at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Feb 19 13:39:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65120
Bug ID: 65120
Summary: [gcc5] Wlogical-not-parentheses should not wanr about
double exclamation !!
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: jirislaby at gmail dot com
While warning about
"if (!a == b)"
is perfectly fine and I like it, I do not like warning about
"if (!!a = b)"
at all. It generates plenty of false positives (in the Linux kernel at least)
and I doubt it can warn about an error at all.
Better than papering over this as
"if ((!aa) = b)"
or by -Wno-logical-not-parentheses does not make much sense to me (opposing to
the single ! case).
Note: this is all about:
"logical not is only applied to the left hand side of comparison"
More information about the Gcc-bugs
mailing list