J
Jun Woong
Lawrence Kirby said:[...]There are two assignments here. In one assignment, p is modified. The
prior value of p is arguably used to determine the new value stored into
p, as you explained, but it is _also_ read to determine at which memory
location the second assignment will happen, so it is not _only_ read to
determine the value stored, therefore undefined behavior.
In p=p->next=q it is *only* accessed in the expression that calculates the
new value to be assigned.
But it's *not* that it's accessed *only* to get the new value to be
stored. You seem to already agree with this. Then you should admit it
results in undefined behavior.
The inner assignment is part of that evaluation,
the fact that it has another side-effect on a distinct object is neither
here nor there, why should it be relevant?
See http://groups.google.co.kr/[email protected]