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

Karl Krach
Thu Nov 18 11:16:00 GMT 2010


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...

Thanks a lot,



Command line:
    g++ -c -pipe -Werror -g -fPIC -Wall -W -D_REENTRANT 
-DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. 
-I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui 
-I/usr/include/qt4/Qt3Support -I/usr/include/qt4 -o OBJ_x11/xxx.o 
No warning on g++ 4.4.5 for this:
    int hugo = 3.27;

More information about the Gcc-help mailing list