this code.. void main(void){ int a=0; cout << ((++a)+(++a)) << endl; } will produce 4 on x86, but 3 on every other arch I can test. Release: gcc 2.95.2 Environment: MAC OS X and Debian Linux.
State-Changed-From-To: open->closed State-Changed-Why: Not a compiler bug. There are zero sequence points within this expression: ((++a)+(++a)) In semi-layman's terms, prefix and postfix ++/-- may only be used once per object per pair of consecutive sequence points. If you don't know what a sequence point is, then please consult the C standard for more details...
Reopening to ...
Mark as a dup of bug 11751. *** This bug has been marked as a duplicate of 11751 ***