User account creation filtered due to spam.

Bug 5494 - ((++a)+(++a)) yeilds 4 on x86, but 3 on everything else.
Summary: ((++a)+(++a)) yeilds 4 on x86, but 3 on everything else.
Status: RESOLVED DUPLICATE of bug 11751
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 2.95.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-25 11:36 UTC by carpman
Modified: 2005-04-20 02:57 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description carpman 2002-01-25 11:36:00 UTC
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.
Comment 1 Loren Rittle 2002-01-25 16:00:59 UTC
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...
Comment 2 Andrew Pinski 2005-04-20 02:57:06 UTC
Reopening to ...
Comment 3 Andrew Pinski 2005-04-20 02:57:21 UTC
Mark as a dup of bug 11751.

*** This bug has been marked as a duplicate of 11751 ***