VMS Help CXX, Qualifiers, /EXCEPTIONS *Conan The Librarian |
/EXCEPTIONS /EXCEPTIONS=CLEANUP (D) /EXCEPTIONS=NOCLEANUP (Alpha only) /EXCEPTIONS=EXPLICIT (D) /EXCEPTIONS=IMPLICIT (Alpha only) /NOEXCEPTIONS Controls whether support for C++ exceptions is enabled or disabled. C++ exceptions are enabled by default (equivalent to /EXCEPTIONS=CLEANUP). When C++ exceptions are enabled, the compiler generates code for throw expressions, try blocks, and catch statements. The compiler also generates special code for main programs so that the terminate() routine is called for unhandled exceptions. You can select from the following options: CLEANUP Generate cleanup code for automatic objects. When an exception is handled at run-time and control passes from a throw-point to a handler, call the destructors for all automatic objects that were constructed because the try-block containing the handler was entered. NOCLEANUP Do not generate cleanup code. Using this option can (Alpha reduce the size of your executable when you want to only) throw and handle exceptions and cleanup of automatic objects during exception processing is not important for your application. The NOCLEANUP option is ignored on I64 systems. EXPLICIT Tells the compiler to assume the standard C++ rules about exceptions. Catch clauses can catch only those exceptions resulting from the evaluation of a throw expression within the body of the catch clause's try block or from within a procedure called from within the catch clause's try block. IMPLICIT On Alpha systems, tells the compiler that an exception (Alpha might be thrown at any time the program is executing only) code within the body of the try block. These exceptions might be the result of a throw expression, hardware errors, or software errors (such as dereferencing an invalid pointer). Specifying /EXCEPTIONS=IMPLICIT seriously interferes with the compiler's ability to optimize code. When the compiler optimizes a function, it must ensure that the values of all variables after an exception is caught remain the same as they were at the point where the exception was throw. The optimizer is therefore limited in its ability to rearrange stores and expressions that might cause an exception to be thrown. With /EXCEPTIONS=EXPLICIT, this is not a serious restriction, because the compiler cannot rearrange stores and expressions around the code that explicitly raises an exception. In implicit exception mode, however, almost any code has the potential to cause an exception to be thrown, thereby dramatically reducing the optimizer's ability to rearrange code. Also, if the compiler can determine that no throw expressions occur within a try block, it can eliminate the exception handling overhead the try block introduces, including all code within the catch clauses associated with the try block. Because no exceptions can occur during the execution of the code within the try block, no code within the catch clauses can ever be executed. The compiler cannot do this with /EXCEPTIONS=IMPLICIT. Use /EXCEPTIONS=IMPLICIT if your program converts signals to C++ exceptions by calling cxxl$set_ condition(cxx_exception). Failure to do so may result in your code not catching the exceptions produced by signals. The /NOEXCEPTIONS qualifier disables C++ exceptions as follows: 1. The compiler issues errors for throw expressions, try blocks, and catch statements, but might generate code for these constructs. 2. On Alpha systems, the compiler does not generate cleanup code for automatic objects. 3. The compiler does not generate special code for main programs so that the terminate() function is called for unhandled exceptions. The /EXCEPTIONS qualifer defines the macro __EXCEPTIONS.
|