lkml.org 
[lkml]   [2019]   [Aug]   [1]   [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 23:10 -0700, hpa@zytor.com wrote:
> On July 31, 2019 4:55:47 PM PDT, Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote:
> > On Wed, Jul 31, 2019 at 11:01 PM <hpa@zytor.com> wrote:
> > > The standard is moving toward adding this as an attribute with the
> > [[fallthrough]] syntax; it is in C++17, not sure when it will be in C
> > be if it isn't already.
> >
> > Not yet, but it seems to be coming:
> >
> > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2268.pdf
> >
> > However, even if C2x gets it, it will be quite a while until the GCC
> > minimum version gets bumped up to that, so...
> >
> > Cheers,
> > Miguel
>
> The point was that we should plan ahead in whatever we end up doing.

Using a local keyword will allow any compiler to work successfully.

It's pretty simple to modify this to something like

#define fallback [[fallback]]



\
 
 \ /
  Last update: 2019-08-01 09:53    [W:0.156 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site