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: Wolfgang Wegner
Subject: Re: [avr-gcc-list] OT Generic C question
Date: Tue, 20 Sep 2005 13:16:25 +0100

Hi,
On 20 Sep 2005 at 6:41, 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 
I think that the right-hand side is completely evaluated before 
applying the result to the left-hand side, such that you could also 
think of it like this:

i=0;
tmp=i;
i++;
i = tmp;

I do not know if this is compiler-dependent, but I would not count on 
the behaviour with this code.

Regards,
Wolfgang






reply via email to

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