avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] OT Generic C question


From: Russell Shaw
Subject: Re: [avr-gcc-list] OT Generic C question
Date: Tue, 20 Sep 2005 22:36:24 +1000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050802 Debian/1.7.10-1

Trampas wrote:
I was helping a friend debug some code, he is new to C,  using the Keil
version of GCC for ARM. Anyway I found the following:

int i;

i=0;
i=i++;
//i was still zero that
That is i=i++ never incremented i, now I would have thought the line would
be the same as:

i=i;
i=i+1;
So you guys are the smartest people I know when it comes to C so I thought I
would ask you guys if this is a compiler bug or is my understanding of C
just been shaken.

Bad C.

http://www.eskimo.com/~scs/C-faq/s3.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]