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

Table Of Contents
Compiling, Binding, and Accelerating TNS C
Programs
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
14-3
Specifying Header Files
You cannot use the RUNNABLE and SEARCH pragmas. However, you can direct the
TNS c89 utility to bind implicitly after a compilation. You can also specify library
files to be searched using the TNS c89 -L flag.
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, in
addition to 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 NonStop 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 more 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 details, see the description of pragma
SSV
on page 13-96.
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.