You copied the Doc URL to your clipboard.

-fexceptions, -fno-exceptions

Enables or disables the generation of code needed to support C++ exceptions.

Default

The default is -fexceptions for C++ sources. The default is -fno-exceptions for C sources.

Usage

Compiling with -fno-exceptions disables exceptions support and uses the variant of C++ libraries without exceptions. Use of try, catch, or throw results in an error message.

Linking objects that have been compiled with -fno-exceptions automatically selects the libraries without exceptions. You can use the linker option --no_exceptions to diagnose whether the objects being linked contain exceptions.

Note

If an exception propagates into a function that has been compiled without exceptions support, then the program terminates.

Was this page helpful? Yes No