This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/66673] Wsequence-point warning missing when swapping variables via chained xor


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]