[Info-vax] yet another sys$qiow question
JF Mezei
jfmezei.spamnot at vaxination.ca
Fri Aug 21 23:00:56 EDT 2015
On 15-08-21 16:57, Stephen Hoffman wrote:
> otherwise apparently and fully back in scope. This implies that the
> compiler either has to assume that any variable that gets passed by
> reference and that goes out of scope might then change at any time
Just thinking out loud here...
Could this be accomplished by declaring certain routines to be
"volatile" meaning that any variable passed to the subroutine should be
considered volatile ?
for instance, in the #include that defines SYS$QIO, you would have
volatile int SYS$QIO (args...)
so when you call SYS$QIO in your code and pass &myIOSB, the compiler
would know that myIOSB should be treated as volatile because it is
involved in a subroutine that is declared as volatile.
The advantage of doing it this way is that current code which is written
without knowledge of this "volatile" business would run fine because the
compiler would not optimize stuff like IOSB or any other arguments
passed to the routine since it would know the routine can do stuff
behind the scenes after it has returned control to the C program that
called it.
More information about the Info-vax
mailing list