K
Keith Thompson
[email protected] said:osmium said::
First off, the exact rule we're talking about (C99 6.5p2) is:Between the previous and next sequence point an object shall have
its stored value modified at most once by the evaluation of an
expression. Furthermore, the prior value shall be read only to
determine the value to be stored. [snip]
What is going on here? A real answer? After only 55 or so posts?
A real answer had to await a real question.
Hello Keith, good night.
I come up with another thought which I had it at the beginning. I
think,
i = i++;
consists of
i++ /*A*/
i = i /*B*/
The order of the sequence of A and B isn't certain. Though operation A
and B are between the same two sequence points, I think the real one
modification is A. i = i just does nothing to the value of i. If i = i
can be omitted, i = i++; is correct (also not undefined). Do you think
so?
No, you're wrong. A and B both modify i, and they do so between two
consecutive sequence points, so the behavior is undefined.
The behavior is undefined.
THE BEHAVIOR IS UNDEFINED!
Don't expect me to waste any more time answering this again.