This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47412] Output: x = 31 but y = 30
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 22 Jan 2011 14:16:45 +0000
- Subject: [Bug c++/47412] Output: x = 31 but y = 30
- Auto-submitted: auto-generated
- References: <bug-47412-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47412
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-01-22 14:16:26 UTC ---
(In reply to comment #0)
> x = 20 + x++;
This is undefined behaviour because there is no sequence point between the
increment and the assignment.
Compiling with -Wall warns you about it