J
Joona I Palaste
Andrey Tarasevich said:Joona said:Someone also mentioned something along the lines of a[a]=i. This I
would consider defined behaviour, because what is being modified is
a[a], and its old value is never used in the expression at all.
In general case it is possible that a == i, in which case the problem
is rather obvious. This example is specifically targeted at this
particular situation.
If a==i, then the expression is equivalent to a=i. However, this
is still very much defined behaviour, as the object being modified is
a, and its old value is not actually used for anything at all in the
above code. Note that even though a==i that doesn't mean that
&(a)==&i, i.e. changing one won't affect the other.
--
/-- Joona Palaste ([email protected]) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"'It can be easily shown that' means 'I saw a proof of this once (which I didn't
understand) which I can no longer remember'."
- A maths teacher