public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/5494: ((++a)+(++a)) yeilds 4 on x86, but 3 on everything else.
@ 2002-01-25 16:01 ljrittle
  0 siblings, 0 replies; 2+ messages in thread
From: ljrittle @ 2002-01-25 16:01 UTC (permalink / raw)
  To: carpman, gcc-bugs, gcc-prs, nobody

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c++/5494: ((++a)+(++a)) yeilds 4 on x86, but 3 on everything else.
@ 2002-01-25 11:36 carpman
  0 siblings, 0 replies; 2+ messages in thread
From: carpman @ 2002-01-25 11:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5494
>Category:       c++
>Synopsis:       ((++a)+(++a)) yeilds 4 on x86, but 3 on everything else.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 25 11:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Guild of the Void Pointer
>Release:        gcc 2.95.2
>Organization:
>Environment:
MAC OS X and Debian Linux.
>Description:
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.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-01-26  0:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-25 16:01 c++/5494: ((++a)+(++a)) yeilds 4 on x86, but 3 on everything else ljrittle
  -- strict thread matches above, loose matches on Subject: below --
2002-01-25 11:36 carpman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).