[Bug c/71926] New: wrong -Wparentheses warning
izaberina at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Jul 19 04:02:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71926
Bug ID: 71926
Summary: wrong -Wparentheses warning
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: izaberina at gmail dot com
Target Milestone: ---
int main() {
int a = 1, b = 2, c = 3, d = 4;
if (a = 2 || (b != 3 &&
c != 4 && d != 5)) return 1;
return 0;
}
-Wparentheses produces the following warning:
gccfail.c:4:23: warning: suggest parentheses around assignment used as truth
value [-Wparentheses]
c != 4 && d != 5)) return 1;
^
gcc found the problem, but the warning is pretty misleading: i was about to
ignore it because it looked like a bogus warning
More information about the Gcc-bugs
mailing list