The IBM C and C++ Compilers library provides a default exception handling function, _Exception. This function is the C language exception handler. By default, _Exception is registered automatically for every process or thread launched by functions provided by IBM C and C++ Compilers. The default handler maps recognized Windows exceptions to C signals, which are then passed by the run-time library to the appropriate signal handlers.
The table below shows which types of Windows exceptions are recognized by _Exception, the names of the exceptions, and the C signals to which each exception type is mapped. These are the only OS/2 exceptions handled by _Exception. The table also shows whether the program can continue if the corresponding signal handler is SIG_IGN or if a user-defined signal handler returns. A No means that the program terminates unless the signal has a handler that calls longjmp to jump to transfer control.
If the signal handler value is set to SIG_DFL, the default action taken for each of these exceptions is to terminate the program with an exit code of 99.
| Windows Exception | C Signal | Continuable? |
|---|---|---|
Divide by zero
|
SIGFPE | No |
NPX387 error
|
SIGFPE | No; except for EXCEPTION_FLT_INEXACT_RESULT |
Overflow occurred
This exception is never caused by code generated by IBM C and C++ Compilers. |
SIGFPE | Yes; resets the overflow flag |
Bound opcode failed
This exceptions is never caused by code generated by IBM C and C++ Compilers. |
SIGFPE | No |
Opcode not valid
|
SIGILL | No |
General Protection fault
|
SIGSEGV | No |
Ctrl-Break
|
SIGBREAK | Yes |
Ctrl-C
|
SIGINT | Yes |
End process
|
SIGTERM | Yes |
![]()
Signals
and Exceptions
Handling
Signals and Exceptions
Using Exception
Handlers in Multi-Thread Programs
Using
Signal and Exception Handlers in DLLs
![]()
Handle
Floating-Point Exceptions
Write or
Register an Exception Handler
![]()
Asynchronous
Exceptions
Signals and Default
Handlers