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 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.

-- 
Joseph S. Myers
joseph@codesourcery.com

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