[Top][All Lists]

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

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

From: varsha
Subject: Re: [avr-gcc-list] OT Generic C question
Date: Tue, 20 Sep 2005 17:42:05 +0530

ya variable  i should have increamentd to 1 ...
but i guess u r not using incremented value of i in your program,
so compiler thinks that it is of no use and doesn't do anything with the
variable...you shoud try defining i variable ...then it will not optimise
the code...
and will show you the incremented value...

----- Original Message -----
From: "Trampas" <address@hidden>
To: <address@hidden>
Sent: Tuesday, September 20, 2005 4:11 PM
Subject: [avr-gcc-list] OT Generic C question

> 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
> would ask you guys if this is a compiler bug or is my understanding of C
> just been shaken.
> Regards,
> Trampas
> _______________________________________________
> AVR-GCC-list mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

***********************Confidentiality Notice***************************

 The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain confidential or privileged information. If you are not
the intended recipient, please notify the sender at Divinet or
address@hidden  immediately and destroy all copies of this
message and any attachments.


reply via email to

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