Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The order in which any side effects occur among the initialization list expressions is unspecified. In particular, the evaluation order need not be the same as the order of subobject initialization (C99, Section 6.7.8, "Initialization").

This recommendation is related to EXP30-C. Do not depend on order of evaluation between sequence points, but focuses on behavior that is non-portable or potentially confusing.

Non-Compliant Code Example

...

EXP10-EX4: The left operand of a comma operator is evaluated followed by the right operand. There is a sequence point in between.

EXP10-EX5: There is a sequence point before function calls, meaning that the function designator, the actual arguments, and subexpressions within the actual arguments are evaluated before the function is invoked.

Risk Assessment

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

EXP10-A

2 (medium)

2 (probable)

2 (medium)

P8

L2

...