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: Richard Henderson <rth at redhat 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: Tue, 20 Mar 2007 12:37:16 -0700
- Subject: Re: PR 23572 warnings for out of range floating-point constants
- References: <6c33472e0703141113s4d1c5478q86b861fd5849a654@mail.gmail.com>
On Wed, Mar 14, 2007 at 06:13:38PM +0000, Manuel López-Ibáñez wrote:
> + /* We also give a warning if the value underflows. */
> + if (REAL_VALUES_IDENTICAL (real, dconst0)
> + && !REAL_VALUES_IDENTICAL (realvoidmode, dconst0))
> + warning (OPT_Woverflow, "floating constant exceeds range of %qT", type);
"exceeds" is misleading here.
Also, I think you should be changing the real.c routines a bit here,
as 1e-1000000000 won't be detected, since that underflows inside the
string parser.
r~