
30 Sep
2004
30 Sep
'04
5:25 p.m.
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 read volatile @a x write volatile @a x-1 exit(x-1) in the first case, and exit(0) in the second case. By definition. There's nothing to prove. ;-)