This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/60442] No -Wparentheses warning for "if (a += b)"
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 06 Mar 2014 09:41:11 +0000
- Subject: [Bug c/60442] No -Wparentheses warning for "if (a += b)"
- Auto-submitted: auto-generated
- References: <bug-60442-4 at http dot gcc dot gnu dot org/bugzilla/>
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.