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

Introduction to HP C and C++ for NonStop Systems
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
1-5
TNS/R Native C Compiler
TNS/R Native C Compiler
The TNS/R native C compiler accepts C language source files that comply with either
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 native C compiler can be run in the Guardian and OSS environments or on a PC
as follows:
In the Guardian environment, use the NMC command to run the native compiler.
The NMC command line syntax is similar to that of the C command for running the
TNS 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 native C compiler.
The native c89 utility syntax is similar to that of the TNS c89 utility. 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
Programmers Guide provides guidance on the use of C in the OSS environment.
On a PC running the Windows operating system, use the Enterprise Toolkit (ETK)
or the Tandem Development Suite (TDS) to compile C code. You can also use the
command-line cross compiler (named c89) outside the ETK or TDS. For more
information, see the online help in the ETK or TDS, or the file “Using the
Command-Line Cross Compilers” installed with the ETK compiler package.
The 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/R Native C++ Compiler
There are three versions or dialects of the native C++ compiler; all three versions
accept C++ language source files and support HP language extensions. However, the
three versions support different standards as described in the descriptions of pragmas
VERSION1, VERSION2, and VERSION3.
The native C++ compiler can be run in the Guardian and OSS environments, and on a
PC using the HP Enterprise Toolkit or the Tandem Development Suite, as follows:
In the Guardian environment, use the NMCPLUS command to run the native C++
compiler. NMCPLUS command syntax is similar to that of the C command for
running the TNS C compiler and to that of the Cfront translator. For syntax
information, see Compiling a C Module on page 14-4.
In the OSS environment, use the native c89 utility to run the native C++ compiler.
Native c89 syntax is similar to that of the TNS c89 utility. For syntax information,
see the c89(1) reference page either online or in the Open System Services Shell
and Utilities Reference Manual.