[fpc-devel] volatile variables

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Jun 30 11:45:00 CEST 2011


On 30 Jun 2011, at 10:42, Michael Schnell wrote:

> On 06/29/2011 09:44 PM, Vinzent Höfler wrote:
>> That's Ada's definition of "volatile". C's definition is less  
>> stronger, but
>> should basically have the same effect.
> Nice and what is the FPC definition ?

There is none. FPC has a "volatile" modifier in svn trunk, but it  
currently only affects the node tree optimizer. There are many other  
parts of the compiler that completely ignore it (from the inliner to  
the i386 assembler peephole optimizer), and hence it is probably not  
that useful in its current incarnation.

If such functionality were properly implemented, the final behaviour  
and definition would however probably be pretty much the same as the  
ADA definition Vinzent posted. However, as has been mentioned several  
times before: "volatile" has absolutely no use to make programs thread  
safe. Its only use is for memory mapped I/O.


Jonas


More information about the fpc-devel mailing list