T
Tim Rentsch
(e-mail address removed) writes:
[snip]
Sequence points (and evaluation orders in general) impose a
partial ordering, not a total ordering. Two sequence points in,
for example, the left and right branches of a '+' operator have
no ordering relationship to each other. The words 'previous' and
'subsequent' used in the Standard should be read approximately
as follows:
previous evaluations -- all evaluations guaranteed to start
/before/ the sequence point in question
subsequent evaluations -- all evaluations guaranteed to start
/after/ the sequence point in question
Some evaluations are not guaranteed to start either before
or after a particular sequence point; ie, they may start
"at the same time".
Two key points:
1. What is a 'previous sequence point' or 'subsequent
sequence point' _is always relative to the evaluation
of some expression_. The previous/next sequence points
for evaluating expression X may be different from the
previous/next sequence points for evaluating expression Y;
moreover it is possible to have any ordering relationships
(including no ordering) between those sequence points, as
long as they don't contradict the orderings pX < nX and
pY < nY.
2. Sequence points "exist" only in the abstract machine.
In an actual machine everything can be all mixed up,
under the well-known "as if" rule.
[snip]
I think I have to view sequence points as linear. If they weren't then
how would one interpret the words 'previous' and 'subsequent' in this:
N869 5.1.2.3 paragraph 2
"Accessing a volatile object, modifying an object,
modifying a file, or calling a function that does any of
those operations are all side effects, which are changes
in the state of the execution environment. Evaluation of an
expression may produce side effects. At certain specified
points in the execution sequence called sequence points, all
side effects of previous evaluations shall be complete and
no side effects of subsequent evaluations shall have taken
place."
Sequence points (and evaluation orders in general) impose a
partial ordering, not a total ordering. Two sequence points in,
for example, the left and right branches of a '+' operator have
no ordering relationship to each other. The words 'previous' and
'subsequent' used in the Standard should be read approximately
as follows:
previous evaluations -- all evaluations guaranteed to start
/before/ the sequence point in question
subsequent evaluations -- all evaluations guaranteed to start
/after/ the sequence point in question
Some evaluations are not guaranteed to start either before
or after a particular sequence point; ie, they may start
"at the same time".
Two key points:
1. What is a 'previous sequence point' or 'subsequent
sequence point' _is always relative to the evaluation
of some expression_. The previous/next sequence points
for evaluating expression X may be different from the
previous/next sequence points for evaluating expression Y;
moreover it is possible to have any ordering relationships
(including no ordering) between those sequence points, as
long as they don't contradict the orderings pX < nX and
pY < nY.
2. Sequence points "exist" only in the abstract machine.
In an actual machine everything can be all mixed up,
under the well-known "as if" rule.