[Bug c/66673] Wsequence-point warning missing when swapping variables via chained xor
manu at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jun 25 20:26:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66673
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution|--- |FIXED
--- Comment #9 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Ops, this may have been added recently, it does warn with my GCC 6 build:
test.c:2:6: warning: operation on ‘*a’ may be undefined [-Wsequence-point]
*a ^= *b ^= *a ^= *b;
^
test.c:9:5: warning: operation on ‘a’ may be undefined [-Wsequence-point]
a ^= b ^= a ^= b;
^
Oh, well, then this is INVALID. Sorry for the noise.
More information about the Gcc-bugs
mailing list