Menu

keywords-volatile

Will Pittenger

When applied the the declaration of any data member, local variable, global variable, or parameter; causes the compiler to ensure the variable is always stored in member. The compiler will avoid caching it. This way, external code can be assured it has the latest value in that location. Furthermore, that external code can make changes and be assured the ASIL code won't have an out of date value. Not compatible with const or readonly. Variables of type expression aren't compatible with volatile. Can't be part of a typealias. If you need that, consider rewriting code.

\var\ \volatile\ /TypeDescriptor/ /identifier/ [\=\ /DefaultValue]

For more on what /TypeDescriptor/ can be, see Type descriptors.


Related

Wiki: Keywords
Wiki: keywords-const
Wiki: keywords-expression
Wiki: keywords-readonly
Wiki: keywords-typealias