It is undefined behaviour because var
is modified several times without a sequence point in between. A sequence point would be, for example, a ;
. The commas in parameter lists, do, however, not introduce sequence points, also the order in which the operands are evaluated is undefined (you could say, the code is doubly undefined ...).