This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51625] -Wconversion should be on by default, or at least included in -Wall
- From: "pnf at podsnap dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 30 Dec 2011 17:14:38 +0000
- Subject: [Bug c++/51625] -Wconversion should be on by default, or at least included in -Wall
- Auto-submitted: auto-generated
- References: <bug-51625-4@http.gcc.gnu.org/bugzilla/>
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.