++i++ in Plain English
Blair P. Houghton
bhoughto at pima.intel.com
Sat Apr 20 11:34:15 AEST 1991
In article <FGTAV-9 at xds13.ferranti.com> peter at ficc.ferranti.com (Peter da Silva) writes:
>In article <3845 at inews.intel.com> bhoughto at hopi.intel.com (Blair P. Houghton) writes:
>> Yes, you're right, most of it is moot, but remember that
>> the entire operation is permitted to be "discarded" if
>
> ... and if i isn't volatile ...
Nope. A volatile declaration implies only that a side
effect occurs whenever the variable is named (accessed)
whether you're reading or writing it (i.e., whether it's in
an rvalue or lvalue context). If the compiler's smart
enough to understand that the "side effect is not needed"
(q.v., somewhere in ANSI X3.159-1989; you can use the rest
of the book to define what "needed" means) and the value is
not used, then the evaluation can be elided.
It'd have to be a pretty dang smart compiler, though...
--Blair
"If you can detect no difference,
then there is no difference."
- Houghton's Indeterminacy Corollary
to Heisenberg's Uncertainty Principle
More information about the Comp.std.c
mailing list