??? 06/25/07 01:40 Read: times |
#141206 - Sequence point Responding to: ???'s previous message |
Sequence points are a concept of C/C++. They specify points at which observable effects of a piece of code are guaranteed to have occurred (ie. all side-effects are complete, and values are written back to where they should be).
A classic sequence point violation is "a = a++;" In this case there is one sequence point, which is at the semicolon that terminates the statement. The problem is that the variable "a" is modified twice without an intervening sequence point (once by operator ++, and once by operator =). The order in which these modifications occur (or even whether they are atomic, etc) is not specified. See: http://en.wikipedia.org/wiki/Sequence_point |