Is there a sequence point between these assignments?

前端 未结 6 1730

Is there a sequence point between the two assignments in the following code:

f(f(x=1,1),x=2);
6条回答
  •  孤城傲影
    2021-02-13 10:15

    No there isn't. The standard is indeed ambiguous in this case.

    If you want to confirm that, gcc has this really cool option -Wsequence-point and in this case it will warn you that the operation may be undefined

提交回复
热议问题