Created on 2002-04-23.00:00:00 last changed 207 months ago
[Voted into WP at March 2004 meeting.]
Proposed resolution (April 2003):
Change the example in Clause 7 [expr], paragraph 4 from
[Example:i = v[i++]; // the behavior is unspecified i = 7, i++, i++; // i becomes 9 i = ++i + 1; // the behavior is unspecified i = i + 1; // the value of i is incremented--- end example]
to (changing "unspecified" to "undefined" twice)
[Example:i = v[i++]; // the behavior is undefined i = 7, i++, i++; // i becomes 9 i = ++i + 1; // the behavior is undefined i = i + 1; // the value of i is incremented--- end example]
Notes from October 2002 meeting:
We should find out what C99 says and do the same thing.
I have found what looks like a bug in Clause 7 [expr], paragraph 4:
Between the previous and next sequence point a scalar object shall
have its stored value modified at most once by the evaluation of an
expression. Furthermore, the prior value shall be accessed only to
determine the value to be stored. The requirements of this
paragraph shall be met for each allowable ordering of the
subexpressions of a full expression; otherwise the behavior is
undefined. Example:
i = v[i++]; // the behavior is unspecified
i = 7, i++, i++; // i becomes 9
i = ++i + 1; // the behavior is unspecified
i = i + 1; // the value of i is incremented
--end example]
So which is it, unspecified or undefined?
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2008-10-05 00:00:00 | admin | set | status: wp -> cd1 |
| 2004-04-09 00:00:00 | admin | set | messages: + msg1004 |
| 2004-04-09 00:00:00 | admin | set | status: ready -> wp |
| 2003-11-15 00:00:00 | admin | set | status: review -> ready |
| 2003-04-25 00:00:00 | admin | set | messages: + msg817 |
| 2003-04-25 00:00:00 | admin | set | status: drafting -> review |
| 2002-11-08 00:00:00 | admin | set | messages: + msg749 |
| 2002-11-08 00:00:00 | admin | set | status: open -> drafting |
| 2002-04-23 00:00:00 | admin | create | |