Manuel López-Ibáñez - PR 23572 warnings for out of range floating-point constants (original) (raw)

This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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]

:ADDPATCH c/c++:

At the moment, there is a warning if a floating-point constant is too large to fit in the type's range. In such cases the constant is converted to +inf or -inf. However, there is no warning if the constant is too small and it is taken as 0. The following patch adds such warning. It also adds the possibility of enabling the warning not only with -pedantic but also with -Wconversion (since it fits its definition).

Bootstrapped and regression tested with --enable-languages=all.

I could only test using i686-pc-linux-gnu. Any suggestions to make the tests more portable?

OK for mainline?2007-01-21 Manuel Lopez-Ibanez manu@gcc.gnu.org

PR other/23572

testsuite/

Attachment:wfloatunderflow.diff
Description: Text document


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