This behavior is undefined because it varchanges several times without a sequence point between them. The sequence point will be, for example, a ;. However, the commas in the parameter lists do not enter a sequence point, and the order in which the operands are evaluated is undefined (you can say that the code is doubly undefined ...).
source
share