[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190802110042.GA6957@hmswarspite.think-freely.org>
Date: Fri, 2 Aug 2019 07:00:42 -0400
From: Neil Horman <nhorman@...driver.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc: "H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
Joe Perches <joe@...ches.com>, Pavel Machek <pavel@....cz>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>,
Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"Gustavo A . R . Silva" <gustavo@...eddedor.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Kan Liang <kan.liang@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
Jiri Olsa <jolsa@...hat.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Shawn Landden <shawn@....icu>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] compiler_attributes.h: Add 'fallthrough' pseudo
keyword for switch/case use
On Thu, Aug 01, 2019 at 10:26:29PM +0200, Miguel Ojeda wrote:
> On Thu, Aug 1, 2019 at 10:10 PM <hpa@...or.com> wrote:
> >
> > I'm not disagreeing... I think using a macro makes sense.
>
> It is either a macro or waiting for 5+ years (while we keep using the
> comment style) :-)
>
> In case it helps to make one's mind about whether to go for it or not,
> I summarized the advantages and a few other details in the patch I
> sent in October:
>
> https://github.com/ojeda/linux/commit/668f011a2706ea555987e263f609a5deba9c7fc4
>
> It would be nice, however, to discuss whether we want __fallthrough or
> fallthrough. The former is consistent with the rest of compiler
> attributes and makes it clear it is not a keyword, the latter is
> consistent with "break", "goto" and "return", as Joe's patch explains.
>
I was having this conversation with Joe, and I agree, I like the idea of
macroing up the fall through attribute, but naming it __fallthrough seems more
consistent to me with the other attribute macros. I also feel like its more
recognizable as a macro. Naming it fallthrough just makes it look like someone
forgot to put /**/'s around it to me.
Neil
> Cheers,
> Miguel
>
Powered by blists - more mailing lists