[Bug c/52106] [C11] missing -Wunused-but-set-variable warning with the a = b = ... construct

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 3 17:18:00 GMT 2012


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;



More information about the Gcc-bugs mailing list