Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-09-01 Thread Joseph Myers
On Fri, 1 Sep 2017, Prathamesh Kulkarni wrote: > > If it's an implicit conversion between different enum types, the warning > > is correct. The more important question for the review is: is it correct > > to replace the implicit conversion by an explicit one? That is, for each > > value in the s

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-08-31 Thread Prathamesh Kulkarni
On 26 August 2017 at 04:15, Joseph Myers wrote: > On Tue, 11 Jul 2017, Prathamesh Kulkarni wrote: > >> On 13 June 2017 at 01:47, Joseph Myers wrote: >> > This is OK with one fix: >> > >> >> +C ObjC Var(warn_enum_conversion) Init(0) Warning LangEnabledBy(C >> >> Objc,Wall) >> > >> > I believe the

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-08-25 Thread Joseph Myers
On Tue, 11 Jul 2017, Prathamesh Kulkarni wrote: > On 13 June 2017 at 01:47, Joseph Myers wrote: > > This is OK with one fix: > > > >> +C ObjC Var(warn_enum_conversion) Init(0) Warning LangEnabledBy(C > >> Objc,Wall) > > > > I believe the LangEnabledBy arguments are case-sensitive, so you need to

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-08-17 Thread Prathamesh Kulkarni
On 8 August 2017 at 09:51, Prathamesh Kulkarni wrote: > On 1 August 2017 at 00:10, Prathamesh Kulkarni > wrote: >> On 11 July 2017 at 17:59, Prathamesh Kulkarni >> wrote: >>> On 13 June 2017 at 01:47, Joseph Myers wrote: This is OK with one fix: > +C ObjC Var(warn_enum_conversion)

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-08-07 Thread Prathamesh Kulkarni
On 1 August 2017 at 00:10, Prathamesh Kulkarni wrote: > On 11 July 2017 at 17:59, Prathamesh Kulkarni > wrote: >> On 13 June 2017 at 01:47, Joseph Myers wrote: >>> This is OK with one fix: >>> +C ObjC Var(warn_enum_conversion) Init(0) Warning LangEnabledBy(C Objc,Wall) >>> >>> I belie

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-07-31 Thread Prathamesh Kulkarni
On 11 July 2017 at 17:59, Prathamesh Kulkarni wrote: > On 13 June 2017 at 01:47, Joseph Myers wrote: >> This is OK with one fix: >> >>> +C ObjC Var(warn_enum_conversion) Init(0) Warning LangEnabledBy(C Objc,Wall) >> >> I believe the LangEnabledBy arguments are case-sensitive, so you need to >> ha

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-07-12 Thread Sandra Loosemore
On 07/11/2017 06:29 AM, Prathamesh Kulkarni wrote: @@ -6074,6 +6076,12 @@ In C++ enumerated type mismatches in conditional expressions are also diagnosed and the warning is enabled by default. In C this warning is enabled by @option{-Wall}. +@item -Wenum-conversion @r{(C, Objective-C only)}

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-07-11 Thread Prathamesh Kulkarni
On 13 June 2017 at 01:47, Joseph Myers wrote: > This is OK with one fix: > >> +C ObjC Var(warn_enum_conversion) Init(0) Warning LangEnabledBy(C Objc,Wall) > > I believe the LangEnabledBy arguments are case-sensitive, so you need to > have ObjC not Objc there for it to work correctly. (*.opt parsi

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-06-12 Thread Joseph Myers
This is OK with one fix: > +C ObjC Var(warn_enum_conversion) Init(0) Warning LangEnabledBy(C Objc,Wall) I believe the LangEnabledBy arguments are case-sensitive, so you need to have ObjC not Objc there for it to work correctly. (*.opt parsing isn't very good at detecting typos and giving error

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-05-10 Thread Martin Sebor
On 05/10/2017 06:19 AM, Prathamesh Kulkarni wrote: On 9 May 2017 at 23:34, Martin Sebor wrote: On 05/09/2017 07:24 AM, Prathamesh Kulkarni wrote: ping https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00161.html Thanks, Prathamesh On 3 May 2017 at 11:30, Prathamesh Kulkarni wrote: On 3 May 2

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-05-10 Thread Prathamesh Kulkarni
On 9 May 2017 at 23:34, Martin Sebor wrote: > On 05/09/2017 07:24 AM, Prathamesh Kulkarni wrote: >> >> ping https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00161.html >> >> Thanks, >> Prathamesh >> >> On 3 May 2017 at 11:30, Prathamesh Kulkarni >> wrote: >>> >>> On 3 May 2017 at 03:28, Martin Sebor

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-05-09 Thread Pedro Alves
On 05/09/2017 07:04 PM, Martin Sebor wrote: >>> > > -Wassign-enum is a Clang warning too, it just isn't included in > either -Wall or -Wextra. It warns when a constant is assigned > to a variable of an enumerated type and is not representable in > it. I enhanced it for GCC to also warn when the

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-05-09 Thread Martin Sebor
On 05/09/2017 07:24 AM, Prathamesh Kulkarni wrote: ping https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00161.html Thanks, Prathamesh On 3 May 2017 at 11:30, Prathamesh Kulkarni wrote: On 3 May 2017 at 03:28, Martin Sebor wrote: On 05/02/2017 11:11 AM, Prathamesh Kulkarni wrote: Hi, The att

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-05-09 Thread Prathamesh Kulkarni
ping https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00161.html Thanks, Prathamesh On 3 May 2017 at 11:30, Prathamesh Kulkarni wrote: > On 3 May 2017 at 03:28, Martin Sebor wrote: >> On 05/02/2017 11:11 AM, Prathamesh Kulkarni wrote: >>> >>> Hi, >>> The attached patch attempts to add option -Wenu

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-05-02 Thread Prathamesh Kulkarni
On 3 May 2017 at 03:28, Martin Sebor wrote: > On 05/02/2017 11:11 AM, Prathamesh Kulkarni wrote: >> >> Hi, >> The attached patch attempts to add option -Wenum-conversion for C and >> objective-C similar to clang, which warns when an enum value of a type >> is implicitly converted to enum value of

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-05-02 Thread Martin Sebor
On 05/02/2017 11:11 AM, Prathamesh Kulkarni wrote: Hi, The attached patch attempts to add option -Wenum-conversion for C and objective-C similar to clang, which warns when an enum value of a type is implicitly converted to enum value of another type and is enabled by Wall. It seems quite useful

[1/2] PR 78736: New warning -Wenum-conversion

2017-05-02 Thread Prathamesh Kulkarni
Hi, The attached patch attempts to add option -Wenum-conversion for C and objective-C similar to clang, which warns when an enum value of a type is implicitly converted to enum value of another type and is enabled by Wall. Bootstrapped+tested on x86_64-unknown-linux-gnu. Is the patch OK for trunk