[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] OT Generic C question
From: |
Alan Kilian |
Subject: |
Re: [avr-gcc-list] OT Generic C question |
Date: |
Thu, 22 Sep 2005 14:00:28 -0500 |
On Thu, 2005-09-22 at 19:12 +0100, Richard Urwin wrote:
> There is a sequence point immediately before the assignment.
> So, far from being a compiler bug, this is absolutely correct behaviour.
> Anything else would be a bug.
>
> 1) The value of i is taken (0)
> 2) i is incremented (to 1)
> ---- sequence point---
> 3) i is set to the value taken (0)
Richard,
Can you explain how you came to the conclusion that there is
a sequence point before the assignment?
Here's an excerpt from:
http://publications.gbdirect.co.uk/c_book/chapter8/sequence_points.html
"This is why you cannot rely on expressions such as:
a[i] = i++;
because there is no sequence point specified for the
assignment, increment or index operators, you don't know when
the effect of the increment on i occurs. "
That section seems to imply that the compiler is NOT broken.
I certainly may be reading this section incorrectly, or it may
be subtly different from the original problem.
I just want to understand a little more.
-Alan
--
- Alan Kilian <kilian(at)bobodyne.com>
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, (continued)
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, David Brown, 2005/09/19
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, Richard Urwin, 2005/09/19
- Re: [avr-gcc-list] Initilizing complex const arrays : syntax ?, David Brown, 2005/09/20
- [avr-gcc-list] OT Generic C question, Trampas, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Bernard Fouché, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Colin Paul Gloster, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, David Brown, 2005/09/20
- RE: [avr-gcc-list] OT Generic C question, Trampas, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Dave Hansen, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Richard Urwin, 2005/09/22
- Re: [avr-gcc-list] OT Generic C question,
Alan Kilian <=
- Re: [avr-gcc-list] OT Generic C question, Dave Hansen, 2005/09/22
- Re: [avr-gcc-list] OT Generic C question, Richard Urwin, 2005/09/22
- Re: [avr-gcc-list] OT Generic C question, Dave Hansen, 2005/09/22
- Re: [avr-gcc-list] OT Generic C question, Alexandru Csete, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Wolfgang Wegner, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Julius Luukko, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Marc Wetzel, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Russell Shaw, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, varsha, 2005/09/20
- Re: [avr-gcc-list] OT Generic C question, Lev Vyskubov, 2005/09/20