https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103123

--- Comment #5 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
(In reply to Andrew Pinski from comment #3)
> Clang produces:
> <source>:4:10: warning: magnitude of floating-point constant too large for
> type 'double'; maximum is 1.7976931348623157E+308 [-Wliteral-range]
>   return 1.0e999;
>          ^

The message is a bit better (it doesn't say "exceeds range", but is not quite
correct since 0x1.fffffffffffff7p1023 doesn't trigger the warning though its
exact value is larger than DBL_MAX), but at least, Clang distinguishes between
floating-point constant overflow (-Wliteral-range) and integer overflow
(-Winteger-overflow).

Reply via email to