This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR 23572 warnings for out of range floating-point constants
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 21 Jan 2007 17:29:14 +0000 (UTC)
- Subject: Re: PR 23572 warnings for out of range floating-point constants
- References: <6c33472e0701210757p2d58f9e3q19992347799ab2ea@mail.gmail.com>
On Sun, 21 Jan 2007, Manuel López-Ibáñez wrote:
> OK for mainline?
No, it is wrong to pedwarn for this, underflow must not be an error with
-pedantic-errors. The constraint in 6.4.4#2 is "The value of a constant
shall be in the range of representable values for its type." and
underflowing values are clearly within the range [-TYPE_MAX, TYPE_MAX].
It may also be wrong to pedwarn for overflow; at least one conformance
testsuite considers overflow to be a constraint violation that requires a
diagnostic (for which GCC uses pedwarn), but DR#025 for C90 says
overflowing values count as within the range [-inf,+inf].
--
Joseph S. Myers
joseph@codesourcery.com