Versions Compared

Key

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

...

Code Block
(*pf[f1()]) (f2(), f3() + f4())

Wiki Markup
the functions {{f1()}}, {{f2()}}, {{f3()}}, and {{f4()}} may be called in any order. All side effects have to be completed before the function pointed to by {{pf\[f1()\]}} is called.

Consequently, the result of this non-compliant code example depends upon unspecified behavior:

...

This code always results in g being assigned the value 2.

Exceptions

EXP10-EX1: The && operator guarantees left-to-right evaluation; there is a sequence point after the evaluation of the first operand.

EXP10-EX2: The || operator guarantees left-to-right evaluation; there is a sequence point after the evaluation of the first operand.

EXP10-EX3: The first operand of a condition expression is evaluated; there is a sequence point after its evaluation. The second operand is evaluated only if the first compares unequal to 0; the third operand is evaluated only if the first compares equal to 0.

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

Risk Assessment

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

EXP10-A

2 (medium)

2 (probable)

2 (medium)

P8

L2

...