DFP compiler option and earlier floating-point applications
As of z/OS® V1R10, there is a risk that earlier C/C++ applications compiled with the DFP option could inadvertently reset the decimal floating-point rounding mode to the default value. You should consider this risk if you are adding decimal floating-point functionality to an application that includes floating-point operations which use the data type fenv_t or the function fesetenv() with the static initializer FE_DFL_ENV. This is because the FE_DFL_ENV and __fe_def_env static initializers set the decimal floating-point rounding mode to the FE_DEC_TONEAREST value.
Be aware of the following constraints
- Because the decimal floating-point rounding mode field is stored in the FPC register separately from the binary floating-point rounding mode, there will be no effect on the binary floating-point rounding mode. However, you should take care with exception handling routines because binary floating-point applications can use FPC exception flags.
- DFP names will not be exposed when the application is compiled without the DFP compiler option. (There may also be a new __STDC_WANT_DEC_FP__ C99 feature test macro to further protect against namespace invasion).
- If you are compiling a System Programming C (SPC) application, you should not use the DFP option; the statically bound version of the SPC function sprintf() does not support decimal floating-point number formats. Standard functions that are already supported in the SPC library (such as printf() and scanf()) will be able to operate on decimal floating-point numbers.