[Bug c/60442] No -Wparentheses warning for "if (a += b)"
chengniansun at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Mar 6 19:41:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60442
--- Comment #3 from Chengnian Sun <chengniansun at gmail dot com> ---
(In reply to Jakub Jelinek from comment #1)
> I'm not convinced there is anything wrong. The reason to warn about if(a =
> b) or if(a = a + b) is that way too often people just mean to write if(a ==
> b)
> or if(a == a + b) instead, but confusing += for == happens orders of
> magnitude less often.
Thanks, Jakub and Jonathan.
More information about the Gcc-bugs
mailing list