According to FAQ, i = i++ is a undefined behaviour in C because this statement has only one sequence point (full expression), and in this statement i has been changed twice (side effect of i++ and =) so it is an undefined behaviour.
Question 1 is do I get that correctly? Or do I misunderstand why i = i++ is undefined?
The second question is that is x = i++ an valid expression?
I guess it is valid and the value of x will always be the origin value of i. Because although there is only one sequence point in this statement, but both x and i are modified only once, and i++ has a higher precedence, which means it should be valid and x++ will always done before the assignment, make x equals to the origin value of x. Is that correct?
xonce, andionce. There’s no multiple writes to a single variable without an intervening sequence point.