Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 3.75 KB

za-ze-disable-language-extensions.md

File metadata and controls

55 lines (39 loc) · 3.75 KB
title ms.custom ms.date ms.technology ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid author ms.author ms.workload
-Za, -Ze (Disable Language Extensions) | Microsoft Docs
11/04/2016
cpp-tools
reference
VC.Project.VCCLWCECompilerTool.DisableLanguageExtensions
/za
/ze
VC.Project.VCCLCompilerTool.DisableLanguageExtensions
C++
-Za compiler option [C++]
Za compiler option [C++]
language extensions, disabling in compiler
-Ze compiler option [C++]
language extensions
enable language extensions
/Za compiler option [C++]
/Ze compiler option [C++]
Disable Language Extensions compiler option
Ze compiler option [C++]
65e49258-7161-4289-a176-7c5c0656b1a2
corob-msft
corob
cplusplus

/Za, /Ze (Disable Language Extensions)

The /Za compiler option emits an error for language constructs that are not compatible with ANSI C89 or ISO C++11. The /Ze compiler option, which is on by default, enables Microsoft extensions.

Syntax

/Za  
/Ze  

Remarks

Note

The /Ze option is deprecated because its behavior is on by default. We recommend you use the /Zc (Conformance) compiler options to control specific language extension features. For a list of deprecated compiler options, see the Deprecated and Removed Compiler Options section in Compiler Options Listed by Category.

The [!INCLUDEvcprvc] compiler offers a number of features beyond those specified in either the ANSI C89, ISO C99, or ISO C++ standards. These features are known collectively as Microsoft extensions to C and C++. These extensions are available by default, and not available when the /Za option is specified. For more information about specific extensions, see Microsoft Extensions to C and C++.

We recommend that you disable language extensions by specifying the /Za option if you plan to port your program to other environments. When /Za is specified, the compiler treats Microsoft extended keywords as simple identifiers, disables the other Microsoft extensions, and automatically defines the __STDC__ predefined macro for C programs.

Other compiler options used with /Za can affect how the compiler ensures standards conformance. For example, /Za and /fp (Specify Floating-Point Behavior) may result in floating-point type promotion behavior that does not conform to the ISO C99 or C++11 standards.

For ways to specify specific standards-conformant behavior settings, see the /Zc compiler option.

For more information about conformance issues with [!INCLUDEvcprvc], see Nonstandard Behavior.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Working with Project Properties.

  2. In the navigation pane, choose Configuration Properties, C/C++, Language.

  3. Modify the Disable Language Extensions property.

To set this compiler option programmatically

  • See xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.DisableLanguageExtensions%2A.

See Also

Compiler Options
Setting Compiler Options
/Zc (Conformance)