[Bug c/60442] No -Wparentheses warning for "if (a += b)"

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 6 09:41:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60442

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I agree with Jakub, the warning is meant to catch typographical errors, not
assignments used as truth values in general.  There's nothing wrong with using
assignments as truth values, as long as that's what you actually intended to
type.



More information about the Gcc-bugs mailing list