[Bug c++/51625] -Wconversion should be on by default, or at least included in -Wall

pnf at podsnap dot com gcc-bugzilla@gcc.gnu.org
Fri Dec 30 17:27:00 GMT 2011


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

--- Comment #3 from Peter Fraenkel <pnf at podsnap dot com> 2011-12-30 17:14:38 UTC ---
Passing a double to a function expecting an int is very likely a bug and
definitely bad style.  The fact that cmath contains overloaded math functions
with the same names as int math function in stdlib.h makes inadvertent misuse a
real danger.  Ideally, this particular conversion would cause a separate
warning, but absent that feature it is safer to warn on any conversion.



More information about the Gcc-bugs mailing list