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: "photon at seznam dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jun 2010 16:46:25 -0000
- Subject: [Bug c++/40752] -Wconversion generates false warnings for operands not larger than target type
- References: <bug-40752-15110@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #18 from photon at seznam dot cz 2010-06-12 16:46 -------
(In reply to comment #17)
> The patch was rejected but it may be accepted by using a new -Wno-* option to
> disable these warnings. Perhaps -Wno-conversion-after-promotion?
>
> Suggestions are welcome.
>
-Wconversion should be fixed to work as specified. No warning should be
generated for the following code:
char c = 2;
// warning: conversion to ?char? from ?int? may alter its value
c >>= 1;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40752