Dealing with volatile in C and C++ is problematic in large parts because what the Standards say isn’t very intuitive and often error-prone. Indeed, volatile isn’t specified normatively, has relatively obscure uses, and is surrounded by myths and legends. This is especially troublesome because volatile is most used to interact with hardware and perform other tricky operations in low-level code. We’ve determined that the languages should be improved and are actively working in that direction: deprecate the dubious and obviously broken uses of volatile in both languages though the C and C++ Standards Committees, standardize replacements which are less error-prone, create advanced diagnostics to help developers write better code. Our ultimate goal: deprecate what remains of volatile.
This talks first helps developers understand volatile because it’s often misunderstood. With that understanding, developers are then walked through the deprecation and replacement plan we’ve set out.