/volatile (volatile Keyword Interpretation)
Specifies how the volatile keyword is to be interpreted.
/volatile:{iso|ms}
We strongly recommend that you use /volatile:iso along with explicit synchronization primitives and compiler intrinsics when you are dealing with memory that is shared across threads. For more information, see volatile (C++).
If you port existing code or change this option in the middle of a project, it may be helpful to enable warning C4746 to identify code locations that are affected by the difference in semantics.
There is no #pragma equivalent to control this option.
To set the /volatile compiler option in Visual Studio
-
Open the Property Pages dialog box for the project. For more information, see How to: Open Project Property Pages.
-
Select the C/C++ folder.
-
Select the Command Line property page.
-
In the Additional options box, add /volatile:iso or /volatile:ms.