Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2004-10-01 07:34:52


Peter Dimov wrote:
>
> Alexander Terekhov wrote:
> > Peter Dimov wrote:
> >>> C'mon, volatile is brain-dead.
> >>
> >> Nobody's arguing otherwise. ;-) But a nop it isn't.
> >
> > Nop works just fine for your volatile accesses. You can't prove non-
> > conformance without trying to fool the program using debugger (or
> > things like that... beyond the scope of the standard).
>
> Argh. The standard says that the compiler MUST ASSUME that volatile variable
> accesses ARE OBSERVABLE by things OUTSIDE OF THE SCOPE of the standard!

Fine. And the ruler of the outside world (implementation) says:
"observe nop and be happy" (or something like that).

[...]
> Look at it this way:
>
> Nop works just fine for your printf statements. You can't prove
> non-conformance without trying to look at a screen (or things like that...
> beyond the scope of the standard).

Right. And any implementation capable to detect that the output
"goes to dev/null" is free to JIT-optimize it to nops. Good for
global environment (less climate change, etc.), you know.

regards,
alexander.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk