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 other/58319] explicit cast doesn't disable -Wconversion warning.


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.

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