C/C++ Programmer's Guide (G06.25+)

Compiling, Binding, and Accelerating TNS C
Programs
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
14-3
Specifying Header Files
You cannot use the SSV pragma. To specify search directories, use the TNS c89
-I flag.
Specifying Header Files
The macros and functions in the C run-time library are declared in header files. Each
header file contains declarations for a related set of library functions and macros, as
well as variables and types that complete that set. If you use a function in the library,
you should include the header file in which it is declared. You should not declare the
routine yourself, because the declarations in the header files have provisions for
several situations that can affect the form of a given declaration, including:
Whether the routine is implemented internally as a function or a macro
Whether the function is written in a language other than C
Whether you are compiling for the small-memory or large-memory model
Whether you are compiling for the 16-bit or 32-bit (wide) data model
Whether you are compiling for the Guardian or OSS environment
In addition, the header file prototype declarations enable the C compiler to check
parameters and arguments for compatibility, ensuring that function calls provide the
correct number and type of arguments.
A single set of C library header files support both the Guardian and OSS environments.
In the Guardian environment, header files are in $SYSTEM.SYSTEM and
$SYSTEM.ZTCPIP by default. In the OSS environment, header files are in
/usr/include and its subdirectories by default.
To specify header files, use the #include preprocessor directive. For details and
examples, see Section 12, Preprocessor Directives and Macros.
In the Guardian environment, the SSV pragma specifies a search list of subvolumes for
files specified in #include directives. For more information, see the description of
pragma SSV on page 13-94.
In the OSS environment, the TNS c89 utility -I flag specifies a search list of
directories for files specified in #include directives.
The TNS c89 utility is located in the /nonnative/bin directory on D40 and later
releases; this utility is not available in H-series RVUs. By default, the native c89 utility
is run. You must set /nonnative/bin at the start of your PATH environment variable
to get the TNS c89 utility instead of the native c89 utility.
For more information, see the TNS c89 online reference page. To view this reference
page, enter:
man -M /nonnative/usr/share/man c89
The c89 reference page in D40 and later versions of the Open System Services Shell
and Utilities Reference Manual describes the native c89 utility.
While header files are optional (but strongly recommended) for programs that contain
Guardian or OSS modules exclusively, header files are required for mixed-module