SPRUI04F july 2015 – april 2023
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 6.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 somewhat. In addition, there is a minimal execution time cost even if exceptions are never thrown, and a slight increase in the data size for the exception-handling tables.
See Section 9.1 for details on the run-time libraries.