H-Series Application Migration Guide (H06.03+)

Native C and C++ Migration Tasks
H-Series Application Migration Guide429855-006
5-2
Possible Source Code Changes
See the C/C++ Programmer’s Guide for details on compiling and linking TNS/E native
C and C++ programs.
Possible Source Code Changes
The following paragraphs describe changes you might need to make to applications
that use certain features.
Check Programs that Use NaN Values
Programs that rely on not-a-number (NaN) values returned by C and C++
mathematical functions will need to be changed to account for differences in NaN
values between TNS/R and TNS/E systems. TNS/R and TNS/E systems use opposite
conventions for returning quiet and signaling NaN values; that is, every bit pattern
specifying a quiet NaN on a TNS/R system specifies a signaling NaN on a TNS/E
system, and every bit pattern specifying a signaling NaN on a TNS/R system specifies
a quiet NaN on a TNS/E system. Also, when arithmetic operations result in a NaN
value, the specific bit pattern generated on the TNS/E system differs from the one
generated on the TNS/R system.
Change Programs that Rely on Proprietary Floating-Point
Format
In native TNS/E C and C++, the default floating-point format is IEEE (IEEE_FLOAT
pragma on the RUN command or -W IEEE_float flag on the c89 command). Programs
that depend on the HP proprietary TNS floating-point format must specify the
TANDEM_FLOAT pragma. (In native TNS/R C and C++, the default floating-point
format is TANDEM_FLOAT.) Keep in mind that results of IEEE floating-point operations
might differ slightly from those of the TNS format.
Check C/C++ Main Routine Object File Name
The C and C++ main routine object file, which contains initialization code for the C and
C++ run-time libraries, has been renamed in the H-series RVUs. This change will affect
build scripts or any other link operation that specifies this file. The new names, along
with the equivalent TNS/R PIC and non-PIC names, are:
File Type Guardian Name OSS Name
TNS/R Non-PIC CRTLMAIN crtlmain.o
TNS/R PIC CCPPMAIN ccppmain.o
TNS/E CCPLMAIN ccplmain.o