http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-16 
11:41:24 UTC ---
(In reply to comment #0)
> This is a request to add a new warning that warns on the subset of 
> -Wconversion
> warnings that involve floating point numbers.  For example, with
> -Wfloat-conversion this would cause a warning:

Should it also warn for non-literals?

int foo(double x)
{
   return x;
}

> I think this could mostly be done by modifying gcc/c-family/c-common.c
> unsafe_conversion_p to add the ability to only warn on conversions where
> REAL_TYPE or REAL_CST are involved.  

Yes, I think it should be easy to implement. You will also need to add a new
option to gcc/c.opt and enable -Wfloat-conversion with -Wconversion (grep for
OPT_Wimplict and how it handles its suboptions).

Unfortunately, I don't have time to work on this, and probably nobody else has,
so you could try to submit a patch: http://gcc.gnu.org/contribute.html

Reply via email to