public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/8030: strange behaviour of side effect operator
@ 2002-09-26 20:12 rth
0 siblings, 0 replies; 2+ messages in thread
From: rth @ 2002-09-26 20:12 UTC (permalink / raw)
To: achille.fouilleul, gcc-bugs, gcc-prs, nobody
Synopsis: strange behaviour of side effect operator
State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Thu Sep 26 20:12:43 2002
State-Changed-Why:
Using -Wall:
z.c:5: warning: operation on `a' may be undefined
In fact, not "may be" but "is".
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8030
^ permalink raw reply [flat|nested] 2+ messages in thread
* c/8030: strange behaviour of side effect operator
@ 2002-09-25 2:46 achille.fouilleul
0 siblings, 0 replies; 2+ messages in thread
From: achille.fouilleul @ 2002-09-25 2:46 UTC (permalink / raw)
To: gcc-gnats
>Number: 8030
>Category: c
>Synopsis: strange behaviour of side effect operator
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Sep 25 02:46:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: achille.fouilleul@gambro.com
>Release: gcc-2.95
>Organization:
>Environment:
both Linux and Cygwin
>Description:
Let's consider the following code:
int main() {
int a = 1;
int b;
b = a++ + a;
printf("%i\n", b);
return 0;
}
this prints "2" with GCC, whereas it prints "3" with CodeWarrior and Lcc.
Hint: I saw that in the assembler output the incrementation statement occurs AFTER the addition one.
>How-To-Repeat:
Just compile it! "gcc bug.c -o bug"
>Fix:
Dunno. Not a gcc expert!
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-09-27 3:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-26 20:12 c/8030: strange behaviour of side effect operator rth
-- strict thread matches above, loose matches on Subject: below --
2002-09-25 2:46 achille.fouilleul
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).