C/C++ Programmer's Guide (G06.25+)
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
11-1
11
Migrating Programs to TNS/R or
TNS/E Native Mode
HP NonStop native mode enables you to write programs that are fully optimized for
TNS/R or TNS/E systems such as NonStop servers. The term TNS/R native means the
program uses the process, memory, and instruction set architectures that are native to
RISC processors. The term TNS/E native means the program uses the process,
memory, and instruction set architectures that are native to Intel Itanium processors.
Native compilers and tools are used to generate native programs. Other tools have
been enhanced to support native programs. Native programs can be written in the
native Portable Transaction Application Language, pTAL (a dialect of the Transaction
Application Language, TAL), C, C++, and native COBOL.
Common tasks required to migrate a TNS C or C++ program to native mode include:
•
Convert programs to use 32-bit pointers and values of type int (the wide or 32-bit
data model and the large-memory model).
•
Replace obsolete keywords and external function declarations.
•
Change code that uses _cc_status for return values.
•
Change code that relies on arithmetic overflow traps.
•
Replace calls to C library functions that cannot be called by native programs.
•
Remove obsolete pragmas.
•
Specify most pragmas on the command line instead of in source files.
The TNS and native C compilers conform to the ISO/ANSI C language standard.
Source code that compiles without warnings or errors with the TNS C compiler or C++
preprocessor might get warnings or errors using the native C and C++ compilers. (In
most cases, the native compilers are better than the TNS compilers in detecting
violations to the ISO/ANSI C standard.)
The native mode C and C++ migration tool, NMCMT, can help you migrate programs to
native mode. The migration tool scans source files and produces a diagnostic listing.
The diagnostic listing identifies C and C++ language source code changes required to
migrate from TNS C and C++ to native C and C++.
The migration tool detects most but not all changes required to migrate a TNS program
to a native program.The migration tool does not detect changes required in areas
outside the C and C++ languages, such as the Guardian and CRE application program
interface (API), or related to converting programs to use the 32-bit data model. For
conversion details, see Converting Programs to the 32-Bit Data Model on page 19-10.
You can use the migration tool in either the Guardian or the OSS environment. The
migration tool is also integrated into the Tandem Development Suite on the PC.