Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.

2019-11-25 Thread Jakub Jelinek
On Mon, Nov 25, 2019 at 03:39:32PM +0100, Jakub Jelinek wrote: > I guess the question is, shall we store the minimum precision needed > somewhere by finish_enum_value_list (perhaps only bother if the precision > of the underlying type is not the same) or compute it each time again > (which would

Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.

2019-11-25 Thread Jakub Jelinek
On Fri, Oct 20, 2017 at 11:59:39AM -0400, Jason Merrill wrote: > > Still, warning when a bit-field can't hold all enumerators instead of > > all values may be a good idea. I've looked into it, and it does require > > recalculating the maximum and minimum enumerator value, since the bounds > > of

Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.

2017-10-20 Thread Jason Merrill
On Wed, Oct 18, 2017 at 3:15 PM, Sam van Kampen via gcc-patches wrote: > On Wed, Oct 18, 2017 at 09:46:08AM -0600, Martin Sebor wrote: >> > Fair enough, I didn't know whether to change the way it currently was >> > triggered. Do you think it should fall under -Wextra (I

Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.

2017-10-19 Thread Martin Sebor
On 10/19/2017 12:38 PM, Eric Gallager wrote: On 10/16/17, Martin Sebor wrote: On 10/16/2017 06:37 AM, Sam van Kampen via gcc-patches wrote: ..I just realised that the clang flag is -Wbitfield-enum-conversion, not -Wenum-bitfield-conversion. Please apply the patch below

Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.

2017-10-19 Thread Eric Gallager
On 10/16/17, Martin Sebor wrote: > On 10/16/2017 06:37 AM, Sam van Kampen via gcc-patches wrote: >> ..I just realised that the clang flag is -Wbitfield-enum-conversion, not >> -Wenum-bitfield-conversion. Please apply the patch below instead, which >> has replaced the two words

Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.

2017-10-18 Thread Martin Sebor
On 10/18/2017 01:15 PM, Sam van Kampen wrote: On Wed, Oct 18, 2017 at 09:46:08AM -0600, Martin Sebor wrote: Fair enough, I didn't know whether to change the way it currently was triggered. Do you think it should fall under -Wextra (I don't think it falls under -Wall, since it isn't "easy to

Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.

2017-10-18 Thread Sam van Kampen via gcc-patches
On Wed, Oct 18, 2017 at 09:46:08AM -0600, Martin Sebor wrote: > > Fair enough, I didn't know whether to change the way it currently was > > triggered. Do you think it should fall under -Wextra (I don't think it > > falls under -Wall, since it isn't "easy to avoid or modify to prevent > > the

Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.

2017-10-18 Thread Martin Sebor
Fair enough, I didn't know whether to change the way it currently was triggered. Do you think it should fall under -Wextra (I don't think it falls under -Wall, since it isn't "easy to avoid or modify to prevent the warning" because it may be valid and wanted behavior), or should it be enabled by

Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.

2017-10-18 Thread Sam van Kampen via gcc-patches
On Mon, Oct 16, 2017 at 11:31:10PM +, 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. > >

Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.

2017-10-18 Thread Sam van Kampen via gcc-patches
On Mon, Oct 16, 2017 at 08:56:05PM -0600, Martin Sebor wrote: > On 10/16/2017 06:37 AM, Sam van Kampen via gcc-patches wrote: > > ..I just realised that the clang flag is -Wbitfield-enum-conversion, not > > -Wenum-bitfield-conversion. Please apply the patch below instead, which > > has replaced

Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.

2017-10-16 Thread Martin Sebor
On 10/16/2017 06:37 AM, Sam van Kampen via gcc-patches wrote: ..I just realised that the clang flag is -Wbitfield-enum-conversion, not -Wenum-bitfield-conversion. Please apply the patch below instead, which has replaced the two words to remove the inconsistency. 2017-10-16 Sam van Kampen

Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.

2017-10-16 Thread Joseph Myers
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

Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.

2017-10-16 Thread Sam van Kampen via gcc-patches
..I just realised that the clang flag is -Wbitfield-enum-conversion, not -Wenum-bitfield-conversion. Please apply the patch below instead, which has replaced the two words to remove the inconsistency. 2017-10-16 Sam van Kampen * c-family/c.opt: Add a warning flag

[patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.

2017-10-16 Thread Sam van Kampen via gcc-patches
This patch adds a warning flag for the warning described in bug report #61414. My proposed warning flag is -Wenum-bitfield-conversion, which corresponds with the warning flag that clang has for a similar warning. 2017-10-16 Sam van Kampen * c-family/c.opt: Add a