This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53064] -Wsequence-point behaves inconsistently
- 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: Tue, 24 Apr 2012 03:51:32 +0000
- Subject: [Bug c/53064] -Wsequence-point behaves inconsistently
- Auto-submitted: auto-generated
- References: <bug-53064-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53064
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-04-24 03:51:32 UTC ---
> a + (++a ? 0 : 0);
Hmm, I don't think there is a sequence point issue here compared to the other
case where it might cause an undefined code.
(++a ? 0 : 0) is all in done in one sequence point so that is defined and then
added to a. a might be accessed before or after the sequence point where a is
modified but there is a sequence point between the access and the modification.