H-Series Application Migration Guide (H06.07+, J06.03+)
Native C and C++ Migration Tasks
H-Series Application Migration Guide—429855-008
5-3
Avoiding Floating-Point Conflicts
For details on which floating-point combinations are valid and which result in errors,
see the C/C++ Programmer’s Guide. That manual also provides information on how to
specify the floating-point format using compiler pragmas and linker options.
If You Are a Provider of Linkfiles or DLLs
If you are a provider of linkfiles or DLLs, you must ensure that the floating-point
attribute for these modules is correctly set; that is, that the floating-point type correctly
reflects the module’s internal floating-point usage. If the floating-point type is not set
correctly, the link or load operation might fail or produce meaningless results.
The floating-point type of a linkfile is initially set at compile time. The default floating-
point type of the C/C++ compiler is IEEE_FLOAT. In each of the following cases, you
can set the floating-point type to NEUTRAL_FLOAT, and the linkfile or DLL with work
with a program that uses either TANDEM_FLOAT or IEEE_FLOAT floating-point type:
•
The linkfile or DLL does not use floating-point,
•
The linkfile or DLL uses floating-point but has no floating-point interaction with the
programs that call it.
•
The linkfile or DLL uses floating-point and, at run time, dynamically determines
whether it will operate as IEEE_FLOAT or TANDEM_FLOAT.
These rules do not apply to programs. If a program has a floating-point type of
NEUTRAL, it is treated as if it had a floating-point type of TANDEM_FLOAT; thus, if it
attempts to load a DLL with a floating-point type of IEEE_FLOAT, the load will fail.
Determining the Floating-Point Type of a Linkfile or DLL
To determine the floating-point type of a linkfile or DLL that you have created, do the
following:
1. Compile the file twice, once with the floating-point type set to IEEE_FLOAT and
once with it set to TANDEM_FLOAT.
2. Compare the resulting object files to see if there are differences other than the time
stamps and the floating-point attribute. If there are differences, the file uses
floating-point arithmetic, and you need to make sure it has the correct floating-point
setting. If not, the file does not use floating-point, and the floating-point attribute
can safely be set to NEUTRAL_FLOAT.
3. Use the enoft listattribute command to determine the file’s floating-point setting.
4. Ensure that the floating-point setting for the file is correct; that is, that it follows the
rules described previously under If You Are a Provider of Linkfiles or DLLs.
You can override the floating-point setting provided by the compiler by specifying the
-set floattype option on the eld command at link time. For more information on
setting or changing the floating-point attribute, see the C/C++ Programmer’s Guide or
the eld manual.










