Re: Implement -Wimplicit-fallthrough: core

2016-08-16 Thread Marek Polacek
On Fri, Aug 12, 2016 at 03:58:51PM +, Joseph Myers wrote: > On Fri, 12 Aug 2016, Marek Polacek wrote: > > > Not sure if error is appropriate here, or whether I should downgrade the > > error to a warning and ignore the attribute. > > I'd say the semantics for uses of attributes that currently

Re: Implement -Wimplicit-fallthrough: core

2016-08-15 Thread Jeff Law
On 08/12/2016 09:58 AM, Joseph Myers wrote: On Fri, 12 Aug 2016, Marek Polacek wrote: Not sure if error is appropriate here, or whether I should downgrade the error to a warning and ignore the attribute. I'd say the semantics for uses of attributes that currently parse should remain unchanged

Re: Implement -Wimplicit-fallthrough: core

2016-08-12 Thread Joseph Myers
On Fri, 12 Aug 2016, Marek Polacek wrote: > Not sure if error is appropriate here, or whether I should downgrade the > error to a warning and ignore the attribute. I'd say the semantics for uses of attributes that currently parse should remain unchanged: they should not be reinterpreted (for non

Re: Implement -Wimplicit-fallthrough: core

2016-08-12 Thread Marek Polacek
On Fri, Jul 29, 2016 at 10:58:28PM +, Joseph Myers wrote: > On Fri, 22 Jul 2016, Marek Polacek wrote: > > > * I noticed that we don't diagnose e.g. '__attribute__((noreturn));' in > > the C FE in certain contexts. Shouldn't be a showstopper though. > > Bug number? shadow_tag_warned is mea

Re: Implement -Wimplicit-fallthrough: core

2016-07-29 Thread Joseph Myers
On Fri, 22 Jul 2016, Marek Polacek wrote: > * I noticed that we don't diagnose e.g. '__attribute__((noreturn));' in > the C FE in certain contexts. Shouldn't be a showstopper though. Bug number? shadow_tag_warned is meant to diagnose empty declarations like that. (That attributes are ignore

Re: Implement -Wimplicit-fallthrough: core

2016-07-28 Thread Marek Polacek
On Wed, Jul 27, 2016 at 02:15:54PM -0600, Jeff Law wrote: > > Yeah, that is true. I'm not sure if the warning can reasonably be expected > > to > > handle all such cases and really see through loops like that, most likely > > not. > > It's really just a heuristics. > > Fortunately I didn't see a

Re: Implement -Wimplicit-fallthrough: core

2016-07-27 Thread Jeff Law
On 07/27/2016 11:59 AM, Marek Polacek wrote: On Wed, Jul 27, 2016 at 11:04:04AM -0600, Martin Sebor wrote: Just a couple of minor things: +@cindex @code{fallthrough} statement attribute +The @code{fallthrough} attribute with a null statement serves as a +fallthrough statement. It hints to the

Re: Implement -Wimplicit-fallthrough: core

2016-07-27 Thread Marek Polacek
On Wed, Jul 27, 2016 at 11:04:04AM -0600, Martin Sebor wrote: > Just a couple of minor things: > > > +@cindex @code{fallthrough} statement attribute > > +The @code{fallthrough} attribute with a null statement serves as a > > +fallthrough statement. It hints to the compiler that a statement > > +t

Re: Implement -Wimplicit-fallthrough: core (take 2)

2016-07-27 Thread Marek Polacek
On Wed, Jul 27, 2016 at 06:46:33PM +0200, Marek Polacek wrote: > +static tree > +warn_implicit_fallthrough_r (gimple_stmt_iterator *gsi_p, bool > *handled_ops_p, > +struct walk_stmt_info *) Yes, bad formatting here. I'll fix. Marek

Re: Implement -Wimplicit-fallthrough: core

2016-07-27 Thread Martin Sebor
Just a couple of minor things: +@cindex @code{fallthrough} statement attribute +The @code{fallthrough} attribute with a null statement serves as a +fallthrough statement. It hints to the compiler that a statement +that falls through to another case label, or user-defined label +in a switch stat

Re: Implement -Wimplicit-fallthrough: core (take 2)

2016-07-27 Thread Marek Polacek
On Fri, Jul 22, 2016 at 01:06:41PM +0200, Jakub Jelinek wrote: > On Fri, Jul 22, 2016 at 12:44:07PM +0200, Marek Polacek wrote: > > --- gcc/gcc/cp/parser.h > > +++ gcc/gcc/cp/parser.h > > @@ -46,7 +46,7 @@ struct GTY (()) cp_token { > > Otherwise, this value is RID_MAX. */ > >ENUM_BITFIE

Re: Implement -Wimplicit-fallthrough: core

2016-07-22 Thread Jakub Jelinek
On Fri, Jul 22, 2016 at 12:44:07PM +0200, Marek Polacek wrote: > --- gcc/gcc/cp/parser.h > +++ gcc/gcc/cp/parser.h > @@ -46,7 +46,7 @@ struct GTY (()) cp_token { > Otherwise, this value is RID_MAX. */ >ENUM_BITFIELD (rid) keyword : 8; >/* Token flags. */ > - unsigned char flags; >