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

Compiling and Linking TNS/E Native C and C++
Programs
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
17-8
Using Link Options to Specify Floating-Point Format
The following combinations are considered to be conflicting and are not allowed to
begin to run:
The case in which the floattype attribute of the program file is IEEE and the user
library file is Neutral is not considered a conflict. In this case, the program is allowed to
execute, and the C/C++ run-time libraries operate in IEEE mode.
If you are using a native user library, the library file should use the same floating-point
format as the program, and the library should be marked accordingly. If the user library
doesn’t use floating point at all, you can mark the library NEUTRAL_FLOAT using the
eld -set floattype or -change floattype command. Then the user library
can be used by any kind of program.
Even if the user library is marked with a floattype attribute that conflicts with the
program file, the program can use the library if it does not call anything in the user
library that uses floating point. In this case, you need to mark the program file with the
eld -set float_lib_overrule on command to disregard the floattype
attribute of the user library file.
In fact, the run-time consistency check can be overruled by using the -set
float_lib_overrule on flag of the eld utility. If you overrule the consistency
check, the operating system allows a floating-point inconsistency between the user
library and the program. If you do not set float_lib_overrule, and there is an
inconsistency between the program file and user library, the operating system
generates an error code and does not run the program.
Linking Mixed-Language Programs
When linking mixed-language programs that use IEEE floating-point format, specify the
-set floattype IEEE flag using the eld utility.
For example, if you have a mixed-language program composed of a C module that
uses IEEE floating-point format, and a COBOL module that doesn’t use floating point
but is marked by the native COBOL compiler as TANDEM_FLOAT, then you could use
the eld -set floattype IEEE_FLOAT command. Or you could first use the eld
-change command to change the COBOL object file to NEUTRAL_FLOAT.
The following example illustrates linking a mixed-language program that uses IEEE
floating-point format:
> ELD $SYSTEM.SYSTEM.CCPLMAIN COBJ EPTALOBJ &
-set floattype ieee_float -o MYEXEC
In this example, the native C object file named COBJ uses IEEE floating-point format,
and the EPTAL-created object file named EPTALOBJ uses Tandem floating-point
format. (Note that EPTAL supports only Tandem floating-point format.) To link these
floattype in program file floattype in user library file
IEEE Tandem
Tandem IEEE
Neutral IEEE