SLAU132V October 2004 – February 2020
The compiler supports the C++ exception handling features defined by the ANSI/ISO 14882 C++ Standard. See The C++ Programming Language, Third Edition by Bjarne Stroustrup. The compiler's --exceptions option enables exception handling. The compiler’s default is no exception handling support.
For exceptions to work correctly, all C++ files in the application must be compiled with the --exceptions option, regardless of whether exceptions occur in that file. Mixing exception-enabled and exception-disabled object files and libraries can lead to undefined behavior.
Exception handling requires support in the run-time-support library, which come in exception-enabled and exception-disabled forms; you must link with the correct form. When using automatic library selection (the default), the linker automatically selects the correct library Section 4.3.1.1. If you select the library manually, you must use run-time-support libraries whose name contains _eh if you enable exceptions.
Using the --exceptions option causes the compiler to insert exception handling code. This code will increase the size of the program, but the EABI implementation requires smaller code size overhead by moving the information to const data sections.
See Section 7.1 for details on the run-time libraries.