Cosider the sequence points in the following expression
i = (++i,i++,i);
If I am correct the steps of execution will be as follows:
1)
++i, i++
2)
step1,i
3)
i = step2
For evaluation in step 1, the value of i should be modified only once for the construct to be termed as defined(since after evaluation of comma operator there is a sequence point). But I think it is not the case here. Hence it should be undefined.
Please see this answer. Here the above expression is termed as defined. Am I missing something ?
The behavior of the following instruction is well-defined.
There is indeed a sequence point between the evaluations of the first and the second operands of the comma operator (
,). The annex C of the standard, although informative, provides a description of the sequence points.