Sequence points and side effects: Quiet change in C11?

前端 未结 4 1105
天涯浪人
天涯浪人 2020-12-31 06:42

C99 §6.5 Expressions

(1) An expression is a sequence of operators and operands that specifies computation of a value, or that designa

4条回答
  •  时光取名叫无心
    2020-12-31 07:07

    As far as I understand it,

    If a side effect on a scalar object is unsequenced relative to ... a value computation using the value of the same scalar object

    does not apply here because of (1) which states that

    The value computations of the operands of an operator are sequenced before the value computation of the result of the operator.

    In other words, the result is defined to "come later", i. e. it is sequenced.

提交回复
热议问题