HP-UX Floating-Point Guide
148 Chapter 5
Manipulating the Floating-Point Status Register
Command-Line Mode Control: The +FP Compiler Option
Command-Line Mode Control: The +FP
Compiler Option
The compiler and linker option +FP allows you to specify what traps to
enable for your program and can also enable or disable flush-to-zero
mode. This option is available with the HP Fortran, C, and Pascal
compilers. It has the following syntax:
+FPflags
where flags is a series of uppercase or lowercase letters from the set
[VvZzOoUuIiDd] with no spaces, tabs, or other characters between
them. If the uppercase letter is selected, that behavior is enabled. If the
lowercase letter is selected or if the letter is not present in the flags, the
behavior is disabled. By default, all traps are disabled.
Table 5-3 describes the behavior specified by each argument.
For example, the following command line sets traps for overflow, divide
by zero, and invalid operations, and enables fast underflow mode:
f77 +FPOZVD program_name.f
The linker (ld) also accepts the +FP option. If you specify this option to a
separately invoked ld command, the option is effective only if you link in
one of the supported startup files (/opt/langtools/lib/*crt0.o).
The +FP option affects the various floating-point mode settings at
program startup. Subsequent calls to fesettrapenable,
fesetflushtozero,orfesetenv may override some or all of the
values set by +FP.
NOTE If you use Fortran, you may also use the +fp_exception (Fortran 90) or
+T (HP FORTRAN/9000) option to set traps at compile time. (If your HP
FORTRAN/9000 program contains an ON statement, you must use +T.)
These options enable traps for invalid operation, overflow, underflow, and
division by zero exceptions. If you specify both +FP and +fp_exception
(or +T), the +fp_exception (or +T) option is always processed after
+FP. It does not turn off any bits set by +FP, however.
See “Using the +FP Compiler Option” on page 153 for more information
on using the +FP option.