[Bug c/11751] New: wrong evaluation of an expression
me at elitsa dot net
gcc-bugzilla@gcc.gnu.org
Thu Jul 31 17:52:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11751
Summary: wrong evaluation of an expression
Product: gcc
Version: 3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: me at elitsa dot net
CC: gcc-bugs at gcc dot gnu dot org
bellow is simple code that express this bug:
/************
* File : b.C
************/
#include <stdio.h>
int main()
{
int a = 1;
printf(" a = %i \n",(a++)+(++a)); //4
a = 1;
printf(" a = %i \n",(a++)+(a++)+(++a)); //4
return 0;
}
After compilation in a following way:
c++ -o b b.C
The result was:
a = 4
a = 4
More information about the Gcc-bugs
mailing list