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

2 The Development Environment
This chapter discusses different environments for developing or compiling C and C++ programs
to run in the OSS environment. These environments include using cross compilers on the PC (used
with the NonStop Development Environment for Eclipse NSDEE) or the HP Enterprise
Toolkit-—NonStop Edition (ETK)) and using development tools directly in the OSS environment. On
G-series systems, you can also use the HP Tandem Development Suite (TDS) for development
functions on the PC, but NSDEE provides many advantages and is the recommended PC-based
development environment. For more information about using NSDEE on a PC, refer to the NSDEE
online help. For more information on using TDS, refer to the TDS online help and to the C/C++
Programmer’s Guide.
The following topics are discussed in This chapter:
“TNS/R Native, TNS/E Native, and TNS Environments” (page 31)
“Compilation Options for C and C++ Programs” (page 33)
“Memory and Data Models in TNS and Native Environments” (page 140)
“Working on the NonStop System” (page 38)
TNS/R Native, TNS/E Native, and TNS Environments
HP has moved from its proprietary TNS run-time environment to the standards-compliant TNS/R
and TNS/E native run-time environments. The native environments support the NonStop operating
system and applications, but the TNS/R native environment is based on reduced instruction-set
computing (RISC) technology and the TNS/E native environment is based on Itanium technology.
TNS/R and TNS/E native processors implement the TNS/R and TNS/E native instruction sets,
respectively, and maintain architectural compatibility with TNS processors.
TNS/R native mode enables you to write programs that take full advantage of the RISC architecture
of TNS/R systems. A program that runs in TNS/R native mode consists entirely of RISC instructions.
TNS/E native mode enables you to write programs that take full advantage of the Itanium
architecture of TNS/E systems. A program that runs in TNS/E native mode consists entirely of
Itanium instructions.
Native programs do not have TNS architecture-specific attributes. Native programs have a different
process and memory architecture than TNS programs.
Many Guardian software products are written to use the RISC or Itanium technology. Being familiar
with the TNS/R or TNS/E native environment is important for programmers migrating Guardian
source code to the Open System Services (OSS) environment, and for those porting C or C++
source code from a UNIX system to the OSS environment. On TNS/R systems, much of the code
supplied by HP for software products for the native environment has been generated using the
native C compilers. On TNS/E systems, virtually all of the code supplied by HP for the native
environment is native code. All OSS programs run as native processes.
HP provides a complete set of C and C++ compilation tools with each native environment. The
TNS/R compilers generate RISC code, which can run only on a TNS/R system. The TNS/E compilers
generate Itanium code, which can run only on a TNS/E system.
The TNS/R and TNS/E native C compilers and the TNS C compiler implement the ISO/ANSI C,
POSIX.1, and POSIX.2 standards and the XPG4 specifications for the C language, plus extensions
defined by HP. However, on H-series systems, the TNS C compiler is supported only in the Guardian
environment; the H-series and J-series OSS environments do not provide a TNS C compiler and
do not support execution of TNS processes. The TNS/R and TNS/E native C compilers also accept
programs written in Common C. These C compilers implement the proposed ANSI standard for
the C++ language and the C++ extensions defined by HP. Using these C compilers is discussed
in “The Development Environment” (page 31).
TNS/R Native, TNS/E Native, and TNS Environments 31