lkml.org 
[lkml]   [2019]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH] compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use
From
Date
On Wed, 2019-07-31 at 11:02 +0200, Peter Zijlstra wrote:
> On Tue, Jul 30, 2019 at 10:35:18PM -0700, Joe Perches wrote:
> > Reserve the pseudo keyword 'fallthrough' for the ability to convert the
> > various case block /* fallthrough */ style comments to appear to be an
> > actual reserved word with the same gcc case block missing fallthrough
> > warning capability.
> >
> > All switch/case blocks now must end in one of:
> >
> > break;
> > fallthrough;
> > goto <label>;
> > return [expression];
> >
> > fallthough is gcc's __attribute__((__fallthrough__)) which was introduced
> > in gcc version 7..
> >
> > fallthrough devolves to an empty "do {} while (0)" if the compiler version
> > (any version less than gcc 7) does not support the attribute.
> >
> > Signed-off-by: Joe Perches <joe@perches.com>
>
> _MUCH_ better than that silly comment, thanks for doing this!
>
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

I also hacked up a little perl script to do most of the
conversions and realignments for the 4200+ current comments.

I'll work on it a bit more and then post it when it's
presentable.

\
 
 \ /
  Last update: 2019-07-31 11:35    [W:0.183 / U:1.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site