Exception compatibility
This section describes the changes in compiler exception handling and propagation for IBM Open XL C/C++ for AIX 17.1.3 in comparison to IBM® XL C/C++ for AIX® 16.1.0 or earlier releases.
Exception handling
IBM Open XL C/C++ for AIX 17.1.3 and IBM XL C/C++ for AIX 16.1.0 that is invoked by xlclang++ generate C++ objects based on the Itanium C++ ABI.
IBM XL C/C++ for AIX 16.1.0 that is invoked by xlC and earlier releases generate C++ objects with a different C++ ABI. New and old C++ ABIs are not compatible.
- If an exception that is generated from code compiled with xlC is
attempted to be caught or unwound in code compiled with xlclang++ or ibm-clang++_r, the
std::terminatehandler is called. - If an exception that is generated from code compiled with
xlclang++ or ibm-clang++_r is attempted to be caught in code compiled with xlC, the
std::terminatehandler is called.
In addition, Open XL C/C++ uses a long traceback table for exception handling, while classic XL C/C++ does not.
Exception propagation (C only)
In IBM Open XL C/C++ for AIX, the default value of the -fexceptions option is -fno-exceptions. When compiling C functions, the compiler might assume that C++ exceptions cannot propagate out of the C functions by default unless the -fexceptions option is specified.
The default behavior of IBM XL C/C++ for AIX 16.1.0 and earlier releases is same as the -fexceptions option being enabled in IBM Open XL C/C++ for AIX. By default, C++ exceptions might propagate out of C functions.