C++ Language/Exception -fno-exceptions

From Software Engineers Wiki
Jump to: navigation, search

What is the effect of -fno-exceptions compiler option?

Answer

This compiler option prevents the compiler handling C++ exceptions. With this, the compiled code does not support stack unwinding, and any exception terminates the program by calling abort(). This reduces the code size because it is not needed to be ready for an exception that may happen inside called subroutines.

When this flag is used: it will break exceptions trying to pass through code compiled with -fno-exceptions whether or not that code has any try or catch constructs.

Exceptions are disabled for Android platform. -mandroid option enables -mbionic, -fPIC, -fno-exceptions and -fno-rtti by default.

References

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox