lkml.org 
[lkml]   [2019]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Use fall-through attribute rather than magic comments
From
Date
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.

There is already a fallthrough: label used in kernel sources
in net/sctp/sm_make_chunk.c that should probably be changed.

\
 
 \ /
  Last update: 2019-06-17 18:28    [W:4.061 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site