Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2004-09-30 14:19:15


Peter Dimov wrote:
>
> Alexander Terekhov wrote:
> > Peter Dimov wrote:
> >>
> >> Alexander Terekhov wrote:
> >>>> No, it's not; C++ behavior _is defined in terms of_ volatile (and
> >>>> I/O calls), not the other way around.
> >>>
> >>> As if rule. And C++ says nothing about mutiple threads.
> >>
> >> Nope. "As if" is defined in terms of observable behavior, and
> >> "observable behavior" is defined in terms of volatile and I/O.
> >
> > int main() {
> > volatile int a = 1;
> > return --a;
> > }
> >
> > prove that it can't be transformed to
> >
> > int main() {
> > }
>
> The observable behavior is
>
> write volatile @a 1

  nop

> read volatile @a x

  nop

> write volatile @a x-1

  nop

> exit(x-1)

  push 0
  call _exit

>
> in the first case, and

Happy now (debugger notwithstanding)? C'mon, volatile is brain-dead.

regards,
alexander.


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