[Info-vax] Volatile, was: Re: yet another sys$qiow question
John Reagan
xyzzy1959 at gmail.com
Thu Aug 20 10:23:10 EDT 2015
On Thursday, August 20, 2015 at 8:59:42 AM UTC-4, Johnny Billquist wrote:
>
> It's more than a "hint". Volatile tells the compiler that it is never
> allowed to optimize away any reads or writes the that variable in the
> code. They all need to be preserved, and the order of reads/writes also
> needs to be preserved.
>
> Johnny
And for stack-based volatile variables, I believe we extend the variable's lifetime to the entire routine. For C scope-variables, I'm not sure if that is extended to just the whole scope or if that is promoted to the enclosing routine.
More information about the Info-vax
mailing list