C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

Using Compiler Pragmas IEEE_Float and Tandem_Float
To use IEEE floating-point format, you can optionally specify the IEEE_FLOAT pragma on the
command line when running the TNS/E native C or C++ compiler. IEEE_FLOAT is the default
setting for TNS/E native compilations.
If you are using TNS/E native C++, you also need to specify the VERSION2 or VERSION3
directive. For more details, see the pragmas IEEE_FLOAT (page 203), VERSION2 (page 254),
and VERSION3 (page 255).
To use Tandem floating-point format, you must specify the TANDEM_FLOAT pragma on the
command line when running the TNS/E native C or C++ compiler.
TANDEM_FLOAT is the default setting for TNS/R native compilations. See the pragma
TANDEM_FLOAT (page 251).
The native compilers set the floating-point format type in the generated object file.
Two examples of compiling native C and C++ programs that use IEEE floating-point format:
> CCOMP / IN SOURCEA, OUT $.#LIST / OBJECTA; IEEE_FLOAT
> CPPCOMP / IN SOURCEB, OUT $S.#LIST / OBJECTB; VERSION2, &
IEEE_FLOAT
Using Link Options to Specify Floating-Point Format
When linking object files using the eld utility, you can specify the floating-point state of the output
object file using the -set floattype flag. You can set any of these options:
TANDEM_FLOAT
IEEE_FLOAT
NEUTRAL_FLOAT
If the -set floattype flag is not specified, the eld utility derives the floating-point state of the output
object file from the states of the input files.
When modifying an existing object file, eld sets the state as specified by the -change floattype
flag.
Link-Time Consistency Checking
The eld utility checks the consistency of floating-point type combinations when linking object files.
The checking differs according to whether the -set flag is specified.
When the floattype attribute is not explicitly set with the -set flag, eld uses the floattype
attribute values of all the input object files for determining the floattype attribute value for the
output object file. If the consistency checks of the input object files result in an invalid floating-point
state or inconsistent value, an error message is generated and no output object file is created.
Table 49 shows the results of each combination of floating-point states when the floattype
attribute is not explicitly specified. The columns Tandem, IEEE, and Neutral, show the number of
input object files characterized by that floating-point setting.
Table 49 Floating Point Consistency Check by eld Utility
Consistency Check ResultNeutralIEEETandem
No message is generated and the output object file has
TANDEM_FLOAT state.
0 or more01 or more
No message is generated and the output object file has
IEEE_FLOAT state.
0 or more1 or more0
Error message is generated. No output object file is created.0 or more1 or more1 or more
No message is generated and the output object file has
NEUTRAL_FLOAT state.
1 or more00
302 Compiling and Linking TNS/E Native C and C++ Programs