Get "int from double" conversion warnings also with GCC 4.4.5

Ian Lance Taylor iant@google.com
Thu Nov 18 22:38:00 GMT 2010


Karl Krach <mailinglists@bluespirit.la> writes:

> I'm working with a team of different developers on different
> systems. I'm using the g++ 4.4.5 and some colleagues the version
> 4.0.5. With the same command line options, they get more
> warnings/errors (-Werror) than me. The most annoying is:
>
>    warning: converting to 'int' from 'double'
>
> How can I enable this warning in g++ 4.4.5 too? I tried -Wconversion,
> but I get also warnings when converting int-to-float, which would
> force me to cast each "float = float * int" statement, which is quite
> common. Also many Qt headers create now warnings, which I cannot
> fix. So this option is no solution for me...

Unfortunately in current gcc I don't think there is a way to get the
warning about assigning a double to an int without getting the warning
about converting to float from int.

Ian



More information about the Gcc-help mailing list