Because the standard doesn't impose any constraint in it.
The section that says this is from 6.5
The grouping of operators and operands is indicated by the syntax.85)
Except as specified later, side effects and value computations of
subexpressions are unsequenced.
From standard itself 6.5.2.2 (Showing an example that standard doesn't impose any constraint)
In the function call
(*pf[f1()]) (f2(), f3() + f4())
the functions f1
, f2
, f3
, and f4
may be called in any order. All side
effects have to be completed before the function pointed to by
pf[f1()]
is called.
The answer to your question would be unspecified. You can't say something for sure. If f1()
is called first result would be something and if it is other way round then the result would be different.
To support what I said check this link
... In the expression f(i++) + g(j++) + h(k++)
, f
is called with a
parameter of the original value of i
, but i
is incremented before
entering the body of f
. Similarly, j
and k
are updated before
entering g
and h
respectively. However, it is not specified in
which order f(), g(), h() are executed, nor in which order i, j, k
are incremented. If the body of f accesses the variables j and k, it
might find both, neither, or just one of them to have been
incremented. (The function call f(a,b,c) is not a use of the comma
operator; the order of evaluation for a, b, and c is unspecified.)