Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)

requires considerations about security mechanisms, use of filenames, recompiling the application,
use of certain commands and statements, and so forth. Refer to the SQL/MP Programming Manual
for C or the SQL/MX Programming Manual for C and COBOL for more information about SQL/MP
or SQL/MX applications in the OSS environment.
C Compiler Issues for Guardian Programs
The Guardian C or C++ programmer has typically used the TNS compiler tools available in the
Guardian environment to build TNS programs. To add open features and performance to a
Guardian TNS program, it is recommended that the programmer use the native compilation tools
described in the C/C++ Programmer’s Guide. The differences between these two sets of tools are
discussed in Chapter 2 (page 31). This subsection is addressed to C or C++ programmers who
wish to use the native tools to add open features to Guardian C programs.
The OSS environment provides powerful program development tools to build and maintain programs.
For the programmer who wants to use these new tools and the associated programming conventions,
consider the issues in the following subsections:
“Compiler Tools” (page 139)
“Memory and Data Models in TNS and Native Environments” (page 140)
“Header Files” (page 140)
“Include File Search Order” (page 141)
“Using Pragmas” (page 141)
“Preprocessor Symbols” (page 141)
“Linking Native Programs” (page 142)
“Binding TNS Programs” (page 142)
“Equivalent OSS Commands for Compiling Guardian Programs” (page 142)
Compiler Tools
From the OSS environment, the c89 utility and the c99 utility establishes an interface to the HP C
compilation system for NonStop systems, providing a simple interface to its components. As
discussed in Chapter 2 (page 31), the native C and TNS C compilation tools differ. These
compilation tools can be used to compile Guardian programs as well as OSS programs. (The TNS
C compilation tools can be used on OSS programs only on G-series systems.) The target system
type can be set explicitly from the command line.
In the OSS environment, the steps to build the final executable programs are typically specified in
a make file. The make file, used by the make utility, contains a list of dependencies for each
executable program to be built, and specifies where each is to be placed in the file system.
A choice of debuggers is available for debugging programs compiled with the TNS or native
compilation components:
On G-series systems, the Inspect debugger can be used to debug programs compiled with
the TNS or TNS/R native compilation components. (TNS/R native programs to be debugged
with Inspect must consist of non-position independent code [non-PIC].)
On G-series systems, the Visual Inspect debugger can be used to debug programs compiled
with the OSS and Guardian TNS or TNS/R native compilation components. (Visual Inspect
can be used for both PIC and non-PIC program files.)
On J-series or H-series systems, the Native Inspect debugger can be used to debug programs
compiled with the TNS/E native compilation components.
On J-series or H-series systems, the Inspect debugger can be used to debug programs compiled
with the Guardian TNS compilation components.
C Compiler Issues for Guardian Programs 139