[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f3138138a67107d84ba014d363df6ca9deba50c5.camel@perches.com>
Date: Mon, 24 Jun 2019 13:57:49 -0700
From: Joe Perches <joe@...ches.com>
To: "Gustavo A. R. Silva" <gustavo@...eddedor.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Kan Liang <kan.liang@...ux.intel.com>,
linux-kernel@...r.kernel.org, Kees Cook <keescook@...omium.org>,
Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Shawn Landden <shawn@....icu>
Subject: Re: [PATCH] perf/x86/intel: Mark expected switch fall-throughs
On Mon, 2019-06-24 at 15:53 -0500, Gustavo A. R. Silva wrote:
> On 6/24/19 3:37 PM, Peter Zijlstra wrote:
> > On Mon, Jun 24, 2019 at 12:45:54PM -0700, Joe Perches wrote:
> > > On Mon, 2019-06-24 at 21:31 +0200, Peter Zijlstra wrote:
> > > > I still consider it an abomination that the C parser looks at comments
> > > > -- other than to delete them, but OK I suppose, I'll take it.
> > > I still believe Arnaldo's/Miguel's/Shawn's/my et al. suggestion of
> > > #define __fallthrough __attribute__((fallthrough))
> > > is far better.
> > Oh yes, worlds better. Please, can we haz that instead?
> Once the C++17 `__attribute__((fallthrough))` is more widely handled by C compilers,
> static analyzers, and IDEs, we can switch to using that instead.
> Also, we are a few
> warnings away (less than five) from being able to enable -Wimplicit-fallthrough. After
> this option has been finally enabled (in v5.3) we can easily go and replace the comments
> to whatever we agree upon.
I doubt waiting is better.
If the latest compilers catch it, it's
probably good enough.
fallthrough or __fallthrough. I don't care which.
I also doubt most static analyzers will parse all
#include headers to find the #define.
Powered by blists - more mailing lists