This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/58319] explicit cast doesn't disable -Wconversion warning.
- 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, 07 Sep 2013 17:52:14 +0000
- Subject: [Bug other/58319] explicit cast doesn't disable -Wconversion warning.
- Auto-submitted: auto-generated
- References: <bug-58319-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58319
Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #4 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #3)
> You can ensure the value is not too large for the target:
>
> X x = { .field = ( u & (-1u >> 1) ) };
It would be nice if gcc accepted (unsigned int:31) as a valid type when
casting. It would help to avoid other Wconversion warnings. It seems a useful
extension to me. Just throwing out the idea there if someone (like the
reporter) considered to give it a try.