This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR 23572 warnings for out of range floating-point constants


On 21/01/07, Joseph S. Myers <joseph@codesourcery.com> wrote:
On Sun, 21 Jan 2007, Manuel López-Ibáñez wrote:

> OK. I didn't know that. Then, should I remove the pedwarn and the
> pedantic check and just warn if -Wconversion ? I think the warning is
> still interesting. And it is an open PR.

I don't feel the interpretation of floating constants is much to do with
-Wconversion since it's the conversion of preprocessing tokens to tokens
with a value, not the conversion of a value from one type to another.

The general issue is floating constants that are not exactly
representable.  Particular cases of interest are overflow, underflow and
hex constants (where C99 recommends a diagnostic for hex floating
constants that are not exactly representable); warning for such cases as
0.1 being inexact is of less interest.  Perhaps there should be a warning
option -Winexact with different levels to cover the different cases.


Fisrt, independently of whether we warn with -Wconversion or not, you said that this shouldn't be a pedwarn. Should I remove the pedwarn then?

Second, it was not my intention to warn for 0.1 being inexact. This
patch doesn't warn for that. It warns when the only representation of
some constant value (without any conversion involved) is either +/-
infinite or 0, because the value is so high or so small that cannot be
represented any other way. That is what I understood that the user
wishes to be warned for (PR23572). If you still think that that
doesn't deserve a warning (be it in Woverflow, Wconversion or
something else), then I will close that PR as WONTFIX.

Cheers,

Manuel.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]