Option Type | Default Value | #pragma options | C | C++ |
-qoption | noflttrap | FLTTRAP | x | x |
Syntax:
-qflttrap | -qflttrap=suboptions | -qnoflttrap FLTTRAP | FLTTRAP=suboptions | NOFLTTRAP
Purpose
Generates extra instructions to detect and trap
floating-point exceptions.
Notes
This option is recognized during linking. -qnoflttrap
specifies that these extra instructions need not be generated.
If specified with #pragma options, the -qnoflttrap option must be the first option specified.
The flttrap option has the following suboptions:
OVerflow | Generates code to detect and trap floating-point overflow. |
UNDerflow | Generates code to detect and trap floating-point underflow. |
ZEROdivide | Generates code to detect and trap floating-point division by zero. |
INValid | Generates code to detect and trap floating-point invalid operation exceptions. |
INEXact | Generates code to detect and trap floating-point inexact exceptions. |
ENable | Enables the specified exceptions in the prologue of the main program. This suboption is required if you want to turn on exception trapping without modifying the source code. |
IMPrecise | Generates code for imprecise detection of the specified exceptions. If an exception occurs, it is detected, but the exact location of the exception is not determined. |
Specifying the flttrap option with no suboptions is equivalent to setting -qflttrap=ov:und:zero:inv:inex. The exceptions are not automatically enabled, and all floating-point operations are checked to provide precise exception-location information.
If your program contains signalling NaNs, you should use the -qfloat=nans along with -qflttrap to trap any exceptions.
The compiler exhibits behavior as illustrated in the following examples when the -qflttrap option is specified together with -qoptimize options:
Example
To compile myprogram.c so that floating-point overflow and
underflow and divide by zero are detected, enter:
xlC myprogram.c -qflttrap=overflow:underflow:zerodivide:enable