We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
unsigned char buf[100] . . . unsigned int val; . . . val = *((unsigned int *)(&buf[1])); . . .
comments?
The result of the evaluation is always thrown avay, since it is evaluated as a void expression.
However, whenever evaluated, any side effects will always be permanent.
Speculative evaluation are outside the scope of any language specification. It is part of compiler optimizations or (more commonly) internal processor optimizations. Speculative evaluation may then be done to process several branches at the same time - but with the requirement that only the side effects of the actually taken branch should be visible to an end user.
In short: Unless you add a break or return statement in the body of the loop, your expr3 side effects will always - for any C/C++ compiler - result in expr3 side effects (the loop variable being updated) until expr2 doesn't allow any furter iterations.
Too thick fingers, or to dim mind...
"your expr3 side effects will always - for any C/C++ compiler - result in expr3 side effects (the loop variable being updated) until expr2 doesn't allow any furter iterations."
Should say "your expr3 evaluations will always - for any C/C++ compiler - result in expr3 side effects (the loop variable being updated) until expr2 doesn't allow any furter iterations."