This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55254] Warn for implicit conversion from int to char
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 14 Nov 2012 17:12:23 +0000
- Subject: [Bug c++/55254] Warn for implicit conversion from int to char
- Auto-submitted: auto-generated
- References: <bug-55254-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55254
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-11-14 17:12:23 UTC ---
An alternative would be to warn for conversion from the char literal '=' to an
integer type. If you said '=' chances are you meant it to be a char, not
int('='). That wouldn't help if using a non-literal char though.
Or, when calling a function with two or more arguments, if all arguments
require an implicit conversion and re-ordering the arguments would require
fewer implicit conversions, suggest the arguments might be ordered incorrectly.
That would be more work (to implement, at on every compilation)