C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

for NonStop Systems. For information about including SRLs at link time, see Determining Which
SRLs are Required (page 295).
You can specify locations to search for header files:
In the Guardian environment, use the SSV pragma to specify a search list of subvolumes for
files specified in #include directives. For more details, see pragma SSV (page 244).
In the OSS environment, use the -I flag to the c89 utility to specify a search list of directories
for files specified in #include directives. For more details, see the c89(1)reference page
either online or in the Open System Services Shell and Utilities Reference Manual.
In the PC (Enterprise Tool Kit) environment, specify a search list of directories using the
Directories page.
In the PC command line environment (using the cross compilers), use the -I flag to the c89
utility to specify a search list of directories for files specified in #include directives. For more
details, see the document Using the Command-Line Cross Compilers on Windows.
While header files are optional (but strongly recommended) for programs that contain Guardian
or OSS modules exclusively, header files are required for mixed-module programs. If you do not
compile using header files, TNS/R native linker cannot correctly resolve external references to
Guardian and OSS versions of C functions.
Compiling and Linking Floating-Point Programs
You can now choose either Tandem floating-point format or IEEE floating-point format for performing
floating-point arithmetic in your native C and C++ programs. This table compares the two formats.
IEEE Floating-Point FormatTandem Floating-Point Format
Is default for the TNS/E native compilers.Is default for the TNS/R native compilers.
Is an industry-standard data format that is supported in the
processor hardware
Is a proprietary implementation of floating-point arithmetic
that is supported in software millicode
Requires the G06.06 release of the HP NonStop OS and
the G06.06 or later product version of the native C and
C++ compilers
Provides backward compatibility with pre-G06.06 C and
C++ applications
For TNS/R native C and C++ programs, IEEE floating-point
format becomes effective only by specifying IEEE_FLOAT
in the command directive
Remains default format on TNS and TNS/R systems, and
is available for TNS C and C++, FORTRAN, TAL, pTAL,
Pascal, COBOL, and native C and C++ programs
Provides easier data interchange with other systems using
64-bit and 32-bit IEEE floating-point data formats;
Requires conversion routines for data interchange between
Tandem format and IEEE format (see the Guardian
interchange typically consists of reversing the byte orderProcedure Calls Reference Manual for more detail about
conversion routines) to convert between big-endian data format (on NonStop
systems) and little-endian format (on the target system)
Provides better handling of exception conditions such as
overflow and underflow; the existence of NaN (not a
number), infinities, and exception flags make it easier to
detect invalid results
Using Compiler Pragmas IEEE_Float and Tandem_Float
To use IEEE floating-point format, you must specify the IEEE_FLOAT pragma on the command
line when running the native C or C++ compiler. If you are using native C++, you also need
to specify the VERSION2 or VERSION3 directive. For more details, see the pragmas
IEEE_FLOAT (page 203), VERSION2 (page 254), and VERSION3 (page 255).
To use Tandem floating-point format, you can optionally specify the TANDEM_FLOAT pragma
(TANDEM_FLOAT is the default setting) on the command line when running the native C or
C++ compiler. See the pragma TANDEM_FLOAT (page 251).
288 Compiling and Linking TNS/R Native C and C++ Programs