[Info-vax] LLVM, volatile and async VMS I/O and system calls
    chris 
    chris-nospam at tridac.net
       
    Fri Sep 24 10:28:46 EDT 2021
    
    
  
On 09/24/21 13:16, Simon Clubley wrote:
> On 2021-09-23, chris<chris-nospam at tridac.net>  wrote:
>>
>> If you look at that use of volatile, it's dealing with sig_atomic,
>> which I would guess to be an interface to a test and set instruction,
>> which is  designed to be indivisible and non interuptable. That is,
>> the whole instruction always executes to completion.
>> More like driver level code, not application, where such
>> functionality would normally be encapsulated into a system call.
>>
>
> Volatile is also set (quite correctly) on the buffer itself.
>
> Simon.
>
Why ?. While the compiler will typically pad out structures to align
each element to the machine wordsize, the use of volatile to define
that buffer is redundant, since no optimisation would apply to
that structure definition anyway.
Use structure overlays for machine register access all the time here
and would never use the volatile keyword for any of it. Machine
register structure pointers, yes, volatile is appropriate and
necessary there...
Chris
    
    
More information about the Info-vax
mailing list