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

Table Of Contents
Introduction to HP C and C++ for NonStop Systems
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
1-13
TNS/E Native C Compiler
TNS/E Native C Compiler
The TNS/E native C compiler accepts C language source files that comply with the
ISO/ANSI C Standard (ISO/IEC 9899:1990, Programming Languages–C or ANSI C
X3.159-1989, Programming Language C) or Common-Usage C (sometimes called
Kernighan and Ritchie C, or K&R C). The native C compiler also accepts HP NonStop
extensions that support the native architecture.
The TNS/E native C compiler can be run in the Guardian and OSS environments, and
on a PC using ETK:
In the Guardian environment, use the CCOMP command to run the TNS/E native
compiler. The CCOMP command-line syntax is similar to that of the NMC
command for running the TNS/R C compiler. For syntax information, see Compiling
a C Module on page 14-4.
In the OSS environment, use the native c89 utility to run the TNS/R or TNS/E
native C compiler. The native c89 utility syntax is the same for the TNS/E and
TNS/R compilers. For syntax information, see the c89(1) reference page either
online or in the Open System Services Shell and Utilities Reference Manual. The
Open System Services Programmer’s Guide provides guidance on the use of C in
the OSS environment.
On a PC running the Windows operating system, use ETK to compile C code. You
can also use the command-line cross compiler (named c89) outside ETK. For
more details, see ETK online help, or the file “Using the Command-Line Cross
Compilers on Windows” installed with ETK compiler package.
The TNS/E native C compiler supports programs that define the size of pointers and
type int as 32 bits (programs compiled with the pragma WIDE). Existing TNS C
language programs that define pointers or type int as 16 bits must be changed. Few
other C language source code changes are required to use the native C compiler.
TNS/E Native C++ Compiler
TNS/E native C++ compiler accepts one of two dialects of the C++ language; both
versions accept C++ language source files and support HP language extensions.
However, the versions support different standards as described in the descriptions of
pragmas VERSION2 on page 13-108 and VERSION3 on page 13-110.
The TNS/E native C++ compiler can be run in the Guardian and OSS environments,
and on a PC using ETK:
In the Guardian environment, use the CPPCOMP command to run the native C++
compiler. CPPCOMP command syntax is similar to that of the NMCPLUS
command for running the TNS/R C++ compiler. For syntax information, see
Compiling a C Module on page 14-4.
In the OSS environment, use the native c89 utility to run the TNS/E native C++
compiler. Native c89 syntax is the same for the TNS/E and TNS/R compilers. For