(C++) volatile

February 24, 2017 · View on GitHub

 

 

 

 

 

(C++) volatile

 

volatile is a keyword to specify a variable can change its value without code making it so, for example the time of a (physical) computer clock: its value is changed by the CPU.

 

Consider never using the volatile keyword, unless directly interfacing with hardware [1].

 

 

 

 

 

References

 

  1. Joint Strike Fighter Air Vehicle C++ Coding Standards for the System Development and Demonstration Program. Document Number 2RDU00001 Rev C. December 2005. AV Rule 205: 'The volatile keyword shall not be used unless directly interfacing with hardware.'