As described in depth in rule DCL34 DCL22-C. Use volatile for data that cannot be cached, a volatile
-qualified variable "shall be evaluated strictly according to the rules of the abstract machine" [ISO/IEC 9899:2011]. In other words, the volatile
qualifier is used to instruct the compiler to not make caching optimizations about a variable.
...
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
DCL17-C | mediumMedium | probableProbable | highHigh | P4 | L3 |
Bibliography
[Eide and Regehr] | "Volatiles Are Miscompiled, and What to Do about It" |
[ISO/IEC 9899:2011] | Subclause 6.7.3, "Type Qualifiers" |
...