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

To specify header files, use the #include preprocessor directive. For example, to include the
STDIO header file, specify in your object file:
#include <stdio.h>
You might also need to specify header files for the TNS/E native Standard C++ Library and
Tools.h++ library to use functions contained in those libraries. For examples of #include directives
for these libraries, see Using the Standard C++ Library and Chapter 6: Accessing Middleware
Using HP C and C++ for NonStop Systems. For information about including DLLs 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 the 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, eld 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
Default for TNS/E modulesDefault for TNS/R modules
An industry-standard data format that is supported in the
processor hardware
A proprietary implementation of floating-point arithmetic
that is supported in software millicode
Requires the G06.06 C and C++ applications and the
G06.06 or later RVUs for the TNS/R native C and C++
Provides backward compatibility with pre-G06.06 C and
C++ applications
compilers; requires the H06.03 or later RVUs for the TNS/E
native C and C++ compilers.
Available only for native C and C++ programs. Used
internally by TNS/E native COBOL programs
Available for TNS C and C++, FORTRAN, TAL, pTAL,
D-series 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
Compiling and Linking Floating-Point Programs 301