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++/47412] Output: x = 31 but y = 30


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47412

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-01-22 17:31:03 UTC ---
(In reply to comment #2)
> It seems interesting for me. It means Java doesn't assume it as an undefined
> behavior point or at least Java's compiler does in a unique way and doesn't
> care about being X or Y.
> Can anyone explain it?

Java is a different language with different rules about evaluation of
expressions.  That code is well-defined in Java, but not C or C++

http://sgaur.wordpress.com/2009/03/30/java-evalorder-ops/
http://stackoverflow.com/questions/2028464/logic-differences-in-c-and-java/


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