Versions Compared

Key

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

...

Evaluation of an expression may produce side effects. At certain specified specific points in the execution sequence called sequence points, all side effects of previous evaluations shall be complete have completed and no side effects of subsequent evaluations shall have yet taken place.

The following are the sequence points defined by C99:

...

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.

This rule means that statements such as:

Code Block

i = i + 1;

are allowed while statements like:

Code Block

i = i++;

are not allowed because it modifies the same value twice.

Non-compliant Code Example 1

...