lkml.org 
[lkml]   [2019]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf/x86/intel: Mark expected switch fall-throughs
On Tue, Jun 25, 2019 at 12:28:23AM +0200, Miguel Ojeda wrote:
> On Mon, Jun 24, 2019 at 10:53 PM Gustavo A. R. Silva
> <gustavo@embeddedor.com> wrote:
> >
> > 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.
>
> Indeed -- the decision last year was to wait for a while since not
> everyone had support for it. My branch is waiting here:
>
> https://github.com/ojeda/linux/tree/compiler-attributes-fallthrough
>
> The good news is that there is some progress. For instance, LLVM is
> working on supporting the GNU spelling:
>
> https://reviews.llvm.org/D63260
> https://bugs.llvm.org/show_bug.cgi?id=37135
> https://github.com/ClangBuiltLinux/linux/issues/235

Can it build a kernel without patches yet? That is, why should I care
what LLVM does?

> Also note that C2x may get [[fallthrough]]. See N2267 and N2335. At
> that point, surely tools/IDEs/analyzers will support it :-) The
> question is whether we want to wait that long to replace the comments.

#define __fallthrough [[fallthrough]]

right?

\
 
 \ /
  Last update: 2019-06-25 09:19    [W:0.096 / U:31.600 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site