This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/40752] -Wconversion generates false warnings for operands not larger than target type
- 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, 05 May 2012 15:30:06 +0000
- Subject: [Bug c++/40752] -Wconversion generates false warnings for operands not larger than target type
- Auto-submitted: auto-generated
- References: <bug-40752-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40752
--- Comment #23 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2012-05-05 15:30:06 UTC ---
(In reply to comment #22)
> If someone really thinks there should be a warning for this behavior, how about
> adding a separate
> -Wchar-arithmetic
> warning which warns on all char arithmetic and see how much people use it.
I think adding a new option Wconversion-after-promotion that covers all cases
where the conversion occurs to the same type that was originally promoted from
would be the most appropriate. I have a feeling that it should not be hard to
implement, but I am not sure how, and I have many other things I would like to
do first. So, please David, Wes, photon, give it a try. The code is in
c-family/c-common.c (conversion_warning).