This is the mail archive of the gcc-bugs@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]

[Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors


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.


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