Disable Microsoft Extensions to C++

Disable language extensions if you plan to port your program to other C compilers. If you disable extensions, the Visual C++ compiler treats extended keywords as simple identifiers, disables the other Microsoft extensions, and automatically defines the __STDC__ predefined macro for C programs. See Microsoft Extensions to C for a list of Microsoft-specific extensions. See the /Za, /Ze (Disable Language Extensions) compiler option topic for details on disabling extensions.

To disable Microsoft extensions to C++

  • Select the Disable language extensions option in the Customize category of the C/C++ tab in the Project Settings dialog box.

     – or – 

    Use the /Za command-line option.

In both methods, the compiler flags language constructs not compatible with ANSI C++ as errors.