From: Pavel Machek <pavel@ucw.cz>
To: Joe Perches <joe@perches.com>
Cc: Shawn Landden <shawn@git.icu>,
linux-kernel@vger.kernel.org,
"Gustavo A . R . Silva" <gustavo@embeddedor.com>,
Andy Whitcroft <apw@canonical.com>
Subject: Re: [PATCH] Use fall-through attribute rather than magic comments
Date: Tue, 18 Jun 2019 12:45:47 +0200 [thread overview]
Message-ID: <20190618104546.GC4541@amd> (raw)
In-Reply-To: <3499a5a2058c246d48f8eb96682ce371833563b2.camel@perches.com>
[-- Attachment #1: Type: text/plain, Size: 1565 bytes --]
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
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
prev parent reply other threads:[~2019-06-18 10:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-16 3:38 [PATCH] Use fall-through attribute rather than magic comments Shawn Landden
2019-03-16 8:08 ` Joe Perches
2019-03-16 21:42 ` Gustavo A. R. Silva
2019-03-18 12:22 ` kbuild test robot
2019-03-18 12:30 ` kbuild test robot
2019-03-19 10:34 ` kbuild test robot
2019-03-19 10:34 ` [PATCH] fix semicolon.cocci warnings kbuild test robot
2019-06-17 15:56 ` [PATCH] Use fall-through attribute rather than magic comments Pavel Machek
2019-06-17 16:25 ` Joe Perches
2019-06-17 16:41 ` David Laight
2019-06-18 7:34 ` Pavel Machek
2019-06-18 9:30 ` Joe Perches
2019-06-18 10:45 ` Pavel Machek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190618104546.GC4541@amd \
--to=pavel@ucw.cz \
--cc=apw@canonical.com \
--cc=gustavo@embeddedor.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shawn@git.icu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.