https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51242

Pavel Revak <pavel.revak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pavel.revak at gmail dot com

--- Comment #30 from Pavel Revak <pavel.revak at gmail dot com> ---
(In reply to Jonathan Wakely from comment #29)
> (In reply to Sasha B from comment #28)
> > You can disregard whether the underlying type is fixed or not. So, GCC
> > should not give a warning unless a bitfield containing Foo really is too
> > small to hold a given value of Foo, warning on the assignment makes sense.
> 
> I agree that we could warn on assignment instead. If the values assigned to
> the bitfield are constant and known to fit, there's no need to warn. See PR
> 61414 for the same warning. I don't know if we need to keep both bugs open.

Yes I agree that this warning has no sense if the constant don't reach the
maximum bits used in bitfield.

Instead of solution where warning is possible to disable with switch will be
better to test if maximum constant in enum will fit into bitfield.

Reply via email to