This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55077] implement and enable by default -Wliteral-conversion
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 27 Oct 2012 19:48:25 +0000
- Subject: [Bug c++/55077] implement and enable by default -Wliteral-conversion
- Auto-submitted: auto-generated
- References: <bug-55077-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55077
--- Comment #1 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2012-10-27 19:48:25 UTC ---
Problem: We do not want to warn for expressions. From the clang testcases:
// Expressions, such as those that indicate rounding-down, should NOT produce
warnings.
int x = 24 * 0.5;
int y = (24*60*60) * 0.25;
int pennies = 123.45 * 100;
But gcc folds those before conversion_warning, so we cannot know they are
expressions... :-(