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

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