[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] OT Generic C question
From: |
Alexandru Csete |
Subject: |
Re: [avr-gcc-list] OT Generic C question |
Date: |
Tue, 20 Sep 2005 16:05:14 +0200 |
On 9/20/05, Mike Murphree <address@hidden> wrote:
[...]
> >
> > Not exactly the gold standard, but Microsoft C7 gives the
> > expected 1, whereas AvrGcc gives 0, So could be a gcc bug.
>
> The increment should take place after the assignment, but I would have
> expected the increment to happen before any other operation. How was he
> verifying what the new value was (e.g. debugger, printf, etc) and when?
>
> Of course, it would have been a lot simpler to just use: i++;
>
Please go and see the link http://www.eskimo.com/~scs/C-faq/s3.html
posted by Russell. It makes it perfectly clear that there is no
expected behaviour in this situation. There is even an equivalent
example where
int i = 3;
i = i++;
gave the values 3, 4 and 7 - each of them equally correct ;-)
> Mike
>
Alex
- Re: [avr-gcc-list] OT Generic C question, (continued)
- Re: [avr-gcc-list] OT Generic C question, Lev Vyskubov, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, David Kelly, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Christopher X. Candreva, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Joerg Wunsch, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Jeff Barlow, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, David Kelly, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Christopher X. Candreva, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Brian Sidebotham, 2005/09/20
- RE: [avr-gcc-list] OT Generic C question, Ron, 2005/09/20
- RE: [avr-gcc-list] OT Generic C question, Mike Murphree, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question,
Alexandru Csete <=
- Re: [avr-gcc-list] OT Generic C question, Mike Murphree, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Wolfgang Wegner, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Anton Erasmus, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Nils Springob, 2005/09/20
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, David Kelly, 2005/09/19
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Vincent Trouilliez, 2005/09/19
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, David Kelly, 2005/09/19
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Vincent Trouilliez, 2005/09/19
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Vincent Trouilliez, 2005/09/19
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Vincent Trouilliez, 2005/09/20