The SDK adds the -fsingle-precision-constant compilation flag even on CPUs that support doubles natively: https://github.com/nxp-mcuxpresso/mcux-sdk/blob/acc105f1e6304bf3a16ebbb503f8882a4daa1408/tools/cmake_toolchain_files/mcux_config.cmake#L34
In standard C, floating-point literals without a suffix like 3.14 have type double and the f suffix as in 3.14f indicates type float. There is no dedicated suffix to enforce the literal type to double - no suffix means double in the standard.
Therefore, adding the mentioned parameter makes it impossible to set double-typed constants, which might be quite surprising as it directly violates the ISO C standard. I think the parameter is ill-fated in general (it hides coding mistakes) but actually hazardous in the case of double-enabled FPUs.
The SDK adds the
-fsingle-precision-constant
compilation flag even on CPUs that support doubles natively: https://github.com/nxp-mcuxpresso/mcux-sdk/blob/acc105f1e6304bf3a16ebbb503f8882a4daa1408/tools/cmake_toolchain_files/mcux_config.cmake#L34 In standard C, floating-point literals without a suffix like3.14
have type double and thef
suffix as in3.14f
indicates type float. There is no dedicated suffix to enforce the literal type to double - no suffix means double in the standard. Therefore, adding the mentioned parameter makes it impossible to set double-typed constants, which might be quite surprising as it directly violates the ISO C standard. I think the parameter is ill-fated in general (it hides coding mistakes) but actually hazardous in the case of double-enabled FPUs.