[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190618104546.GC4541@amd>
Date: Tue, 18 Jun 2019 12:45:47 +0200
From: Pavel Machek <pavel@....cz>
To: Joe Perches <joe@...ches.com>
Cc: Shawn Landden <shawn@....icu>, 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
On Tue 2019-06-18 02:30:35, Joe Perches wrote:
> On Tue, 2019-06-18 at 09:34 +0200, Pavel Machek wrote:
> > On Mon 2019-06-17 09:25:56, Joe Perches wrote:
> > > 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
> > > >
> > > > Is it good idea to add the __'s ? They look kind of ugly.
> > >
> > > Dunno.
> > >
> > > I agree it's kind of ugly, but it should always work.
> > >
> > > I think the generic problem is introducing a new unprefixed
> > > reserved identifier. Underscored identifiers are reserved.
> >
> > We are not userland, and we control whole codebase. These rules don't
> > apply.
>
> except include/uapi where some static inline switch might
>
> > We can use unprefixed identifier and fix up any problems... I don't
> > expect too many.
>
> but there aren't any existing uses there.
Agreed, this is not suitable for uapi. Fortunately, inline functions
should not be common in uapi...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists