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

Native C and C++ Migration Tasks
H-Series Application Migration Guide429855-008
5-2
Possible Source Code Changes
All code generated by the TNS/E native compilers is position-independent code (PIC).
PIC is code that need not be modified to run at different virtual addresses. It is used to
create dynamic-link libraries (DLLs). TNS/E native compilers do not provide an option
to generate non-PIC, and do not support SRLs.
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 -WIEEE_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.
Avoiding Floating-Point Conflicts
The change in the default floating-point format can lead to conflicts that result in link- or
load-time errors, such as the following:
Floating-point type inconsistency among input linkfiles. File
filename specifies ’tandem’. File filename specifies ’ieee’.
You must ensure that the floating-point format used by a program is consistent with the
floating-point format used by any linkfiles or DLLs it uses. These errors can occur when
linking or loading linkfiles or DLLs that you have created or that are supplied by HP or
another vendor.