Versions Compared

Key

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

...

Between the previous and next sequence point an object can only have its stored value modified at most once by the evaluation of an expression. Additionally, the prior value
can be read only to determine the value to be stored.

Non-compliant Code Example 1

In the following example, the order of evaluation of the operands to + is undefined.

...

As a result, programs can not safely rely on the order of evaluatoin of operands between sequence pionts.

Compliant Solution 1

The following examples are independend on the order of evaluation of the operands and can only be interpreted in one way.

...

Code Block
a = i + b[i+1];
++i;

Non-compliant Code Example2Example 2

There is no ordering of subexpressions implied by the assignment operator, so the behavior of the following statements is undefined:

Code Block
i = ++i + 1;
a[i++] = i;

Compliant Solution 2

The following statements are allowed by the standard:

...