Evaluation of function call parameters is "unsequenced" according to the language specification.
Side effects (like pre-/post- -increment/-decrement) on multiple arguments is therefore "undefined behaviour".
I.e. a compiler is free to evaluate function arguments in any order before executing the function body - no guarantee that it is evaluated from left to right, nor from right to left, nor any other sequence.
The only solution to this: don't do (multiple) side effects on the same object in one full expression.
E.g. the following are also undefined behaviour:
int a = ...
int *b = ...
a = b[a++]; a = a++ + 1;
The language specification has several "undefined behaviour". Undefined behaviour is:
"behavior for which this International Standard imposes no requirements".
Cheers
Andi