3 ms·
> Order of evaluation of the operands of any C operator, including the order of evaluation of function arguments in a function-call expression, and the order of
by UncleEntity 7y ago
> Order of evaluation of the operands of any C operator, including the order of evaluation of function arguments in a function-call expression, and the order of evaluation of the subexpressions within any expression is unspecified (except where noted below). The compiler will evaluate them in any order, and may choose another order when the same expression is evaluated again.
Umm...
- pfdietz 7y agoYes, that also sucks. Every undefined behavior in a language standard is a failure of the standard making process, and should be a source of shame. Sometimes it's politically unavoidable (because there are multiple implementations that do something different), or practically unavoidable (the best behavior is not yet known, or impossible to make precise) but every such imprecision is a landmine through which bugs, often insidious ones, can enter programs.