c++/5494: ((++a)+(++a)) yeilds 4 on x86, but 3 on everything else.

ljrittle@gcc.gnu.org ljrittle@gcc.gnu.org
Fri Jan 25 19:47:00 GMT 2002


Synopsis: ((++a)+(++a)) yeilds 4 on x86, but 3 on everything else.

State-Changed-From-To: open->closed
State-Changed-By: ljrittle
State-Changed-When: Fri Jan 25 16:00:59 2002
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...

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5494



More information about the Gcc-bugs mailing list