[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <128384ca2876462b90b9f28db85194fc@AcuMS.aculab.com>
Date: Mon, 17 Jun 2019 16:41:18 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Joe Perches' <joe@...ches.com>, Pavel Machek <pavel@....cz>,
"Shawn Landden" <shawn@....icu>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Gustavo A . R . Silva" <gustavo@...eddedor.com>,
Andy Whitcroft <apw@...onical.com>
Subject: RE: [PATCH] Use fall-through attribute rather than magic comments
From: Joe Perches
> Sent: 17 June 2019 17:26
> On Mon, 2019-06-17 at 17:56 +0200, Pavel Machek wrote:
> > Hi!
> >
> > > +/*
> > > + * gcc: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-fallthrough
> > > + * gcc: https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/
> > > + */
> > > +#if __has_attribute(__fallthrough__)
> > > +# define __fallthrough __attribute__((__fallthrough__))
> > > +#else
> > > +# define __fallthrough
> > > +#endif
Should the trailing ; be added to the above?
I think the above would require:
case foo:
bar();
__fallthrough;
case baz:
When commented out that leaves a completely empty statement (adjacent ;)
I'm sure some compilers complain about those as well.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists