Here's the problem:
With
int a,b,c;
, isa = a * b + a;
equivalent to(c = a * b)!=(a = c + a);
with respect to modification ofa
?
At first glance I think they are the same, but then does specification say that in expr1 != expr2
, expr1
will always be evaluated before expr2
? I think it's not the case but I can't find a definitive source on this.
Also, I'm baffled by the what I found in http://en.cppreference.com/w/c/language/eval_order :
The side effect (modification of the left argument) of the direct assignment operator and of all compound assignment operators is sequenced after the value computation (but not the side effects) of both left and right arguments.
(since C11)
Does this mean I can interpret it as since C11 the above statement will have fixed evaluation order (since assignment is involved), but not pre-C11?