These obnoxious warnings are on-by-default in current gcc, and I can't find which option is needed to disable them. They're generating warning-spam and preventing compiling with -Werror
in code where the behavior gcc warns about is intentional (and comes from general-purpose macros that could not easily avoid generating such constants).
After digging through the GCC source code, I found that the warnings you've described are part of the -Woverflow
option. So just turn off that warning.
By the way, this comment is in the code for the warning:
Both C and C++ require a diagnostic for a floating constant outside the range of representable values of its type... We also give a warning if the value underflows.
In GCC 4.8, each warning comes with a clear indicator of which flag enables it:
floating constant exceeds range of 'double' [-Woverflow]
Good job, GCC devs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With