Is this defined behaviour?
*p += *p--;
And, if it is, is it equivalent to { p[0] += p[0]; --p; }
or to { p[-1] = p[0]; --p; }
?
I'm guessing the being defined or not depends on whether +=
has an implicit sequence point and, if it has, my guess is that the second block should be the correct one.
EDIT: I think it's not a duplicate of the suggested question because the main question there is what are sequence points and how do the affect behaviour. In my case I have clear idea of what a sequence point is and the question is specifically on whether the +=
operator has an implicit sequence point or not.