An evaluation executes a C expression or other construct, producing intermediate values and possibly changing program state. Its effects can include changing the point of execution, computing values, storing values, performing I/O, or changing hidden state such as an atomic flag or mutex state. section 21.0
Even a discarded expression has an effect
The expression `(void)0;` discards its intermediate value, but evaluation still advances the point of execution to the next statement. Therefore, every evaluation has an effect, even when it performs no visible computation or store. section 21.0
Use ordering relations to reason about evaluations across one or more threads:
- Within one thread, sequenced-before evaluations also participate in the happened-before relation. section 21.1
- Between threads, synchronization through atomic operations or specified library calls supplies ordering information. section 21.1
- Modifications of one atomic object follow a modification order consistent with each participating thread’s sequenced-before relation. section 21.1
(void)0;
Inspect the minimal expression that demonstrates why evaluation still changes the abstract execution state when its intermediate value is discarded. section 21.0
