This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Is this a bug?
- From: "Honggang Xu" <hxu at zeugmasystems dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Thu, 16 Jul 2009 11:06:54 -0700
- Subject: RE: Is this a bug?
- References: <DDFD17CC94A9BD49A82147DDF7D545C50176D5AE@exchange.ZeugmaSystems.local>
Or my understand of keyword "volatile" is wrong, following code outputs
compiled by gcc 4.1.1: x=22 ,y=59
main()
{
volatile int x=20,y=35;
x=y++ + x++;
y= ++y + ++x;
printf("x=%d y=%d\n" ,x,y);
}
thanks
Honggang