-fexceptions (-qeh) (C++ only)

Pragma equivalent

None.

Purpose

The -fexceptions option controls whether exception handling is allowed in the module being compiled. The -qeh option controls whether exception handling is enabled in the module being compiled.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-exceptions----.   
>>- -f--+-no-exceptions-+--------------------------------------><

Read syntax diagramSkip visual syntax diagram
        .-eh---.   
>>- -q--+-noeh-+-----------------------------------------------><

Defaults

-fexceptions or -qeh

Usage

When -qeh is in effect, exception handling is enabled. If your program does not use C++ structured exception handling, you can compile with -qnoeh to prevent generation of code that is not needed by your application.

The difference between -fexceptions and -qeh is that -fexceptions allows exception handling while -qeh informs the compiler that exceptions need to be handled. When exceptions are not allowed during a particular compilation process, the compiler assumes that exceptions do not need to be handled; exceptions might originate from code that is compiled separately and still occur.

Specifying -qeh also implies -qrtti. If -qeh is specified together with -qnortti, RTTI information will still be generated as needed.

Predefined macros

__EXCEPTIONS is predefined to 1 when -fexceptions (-qeh) is in effect; otherwise, it is undefined.



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us