This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/40752] -Wconversion generates false warnings for operands not larger than target type


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).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]