This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/52106] [C11] missing -Wunused-but-set-variable warning with the a = b = ... construct
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 03 Feb 2012 17:18:13 +0000
- Subject: [Bug c/52106] [C11] missing -Wunused-but-set-variable warning with the a = b = ... construct
- Auto-submitted: auto-generated
- References: <bug-52106-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52106
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|warning for useless |[C11] missing
|assignments |-Wunused-but-set-variable
| |warning with the a = b =
| |... construct
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-03 17:18:13 UTC ---
> a = b = 0;
In C99 and before is equivalent to b = 0; a = b;
In C11 (which we don't implement this semantics yet), it is a = 0; b = 0;