- 论坛徽章:
- 12
|
回复 6# donotblock
in any order conforming to the precedence rules
这个的意思是“以任何遵守优先级规则的顺序”吧,同样的条目在ISO/IEC 9899:1999(E)(应该就是C99)里面是这样的:
The order in which subexpressions are evaluated and the order in which side effects
takeplace, except as specified for the function-call (), &&, ||, ?:,and comma
operators (6.5).
即子表达式的计算顺序是未指定的。但由于优先级和结合性的规则,为了计算某个子表达式可能需要计算另一个表达式,比如a*b+c,为了计算(a*b)+c,必须先计算a*b,优先级规则限制了这一点。
另外,我认为表达式求值和side effects的发生并不一定同时。标准中只保证某序列点之前的side effects在序列点处已经发生,但子表达式求值总归是有一定顺序的,可能某个表达式被求值了,但side effects并未发生。 |
|