This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
- From: "jjcogliati-r1 at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 20 Sep 2013 16:27:15 +0000
- Subject: [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
- Auto-submitted: auto-generated
- References: <bug-53001-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001
Joshua Cogliati <jjcogliati-r1 at yahoo dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jjcogliati-r1 at yahoo dot com
--- Comment #8 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Created attachment 30870
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30870&action=edit
Patch to add -Wfloat-conversion option
This patch add a -Wfloat-conversion option. It adds an enumeration type called
conversion_safety, with a SAFE_CONVERSION being 0, and unsafe ones being
non-zero. It changes the unsafe_conversion_p to return this enumeration. This
allows the floating point conversions to be handled separately.
Someone who understands the c.opt file better than I should check that I did it
correctly.
-Wconversion implies -Wfloat-conversion. -Wall does not, but it might
possibly be worth considering.