Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 1.82 KB

gx-enable-exception-handling.md

File metadata and controls

40 lines (26 loc) · 1.82 KB
title ms.date f1_keywords helpviewer_keywords ms.assetid
/GX (Enable Exception Handling)
11/19/2019
/gx
exception handling, enabling
/GX compiler option [C++]
-GX compiler option [C++]
cl.exe compiler, exception handling
enable exception handling compiler option [C++]
GX compiler option [C++]
933b43ba-de77-4ff8-a48b-7074de90bc1c

/GX (Enable Exception Handling)

Deprecated. Enables synchronous exception handling using the assumption that functions declared by using extern "C" never throw an exception.

Syntax

/GX

Remarks

/GX is deprecated. Use the equivalent /EHsc option instead. For a list of deprecated compiler options, see the Deprecated and Removed Compiler Options section in Compiler Options Listed by Category.

By default, /EHsc, the equivalent of /GX, is in effect when you compile by using the Visual Studio development environment. When using the command line tools, no exception handling is specified. This is the equivalent of /GX-.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.

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

  3. Type the compiler option in the Additional Options box.

To set this compiler option programmatically

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

See also

MSVC Compiler Options
MSVC Compiler Command-Line Syntax
/EH (Exception Handling Model)