This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.
- From: "Sam van Kampen via gcc-patches" <gcc-patches at gcc dot gnu dot org>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 18 Oct 2017 13:59:16 +0000
- Subject: Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.
- Authentication-results: sourceware.org; auth=none
- References: <20171016111842.zmajbbopy2wkrzjz@segfault.party> <20171016123727.anxuxjzna3be3zyy@segfault.party> <alpine.DEB.2.20.1710162327420.8511@digraph.polyomino.org.uk>
- Reply-to: Sam van Kampen <sam@segfault.party>
On Mon, Oct 16, 2017 at 11:31:10PM +0000, Joseph Myers wrote:
> On Mon, 16 Oct 2017, Sam van Kampen via gcc-patches wrote:
>
> > +Wbitfield-enum-conversion
> > +C++ Var(warn_bitfield_enum_conversion) Init(1) Warning
> > +Warn about struct bit-fields being too small to hold enumerated types.
>
> Any option supported for C++ should also be supported for ObjC++ unless
> there is a clear reason it cannot work for ObjC++.
> [...]
> The documentation of the option also needs to indicate that it's for
> C++/ObjC++ only, similar to other such options.
I've added the ObjC++ flag to the warning declaration above and I've
expanded the documentation to note that it only applies to C++/ObjC++.
> The patch also needs to add a testcase to the testsuite that verifies the
> warnings issues in appropriate cases (and that warnings are not issued
> when the bit-field is large enough).
I've added such a testcase as well. I'll send the updated version of the
patch, I'm just waiting to hear back from Martin on whether the flag
should fall under -Wextra or fall under no flag and be disabled unless
explicitly specified.
> --
> Joseph S. Myers
> joseph@codesourcery.com
Thanks for the feedback,
Sam