This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/11751] New: wrong evaluation of an expression
- From: "me at elitsa dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jul 2003 17:52:02 -0000
- Subject: [Bug c/11751] New: wrong evaluation of an expression
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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