[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72m5=pqHaNi3P5VAMviaoX6yxT7OPg6sys1uMDki0g2bOw@mail.gmail.com>
Date: Tue, 13 Aug 2019 14:44:53 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Joe Perches <joe@...ches.com>,
Nathan Chancellor <natechancellor@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>,
LKML <linux-kernel@...r.kernel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>
Subject: Re: [PATCH] Makefile: Convert -Wimplicit-fallthrough=3 to just
-Wimplicit-fallthrough for clang
On Mon, Aug 12, 2019 at 6:29 PM Nick Desaulniers
<ndesaulniers@...gle.com> wrote:
>
> On Sat, Aug 10, 2019 at 8:06 PM Joe Perches <joe@...ches.com> wrote:
> >
> > On Sat, 2019-08-10 at 19:04 -0700, Nathan Chancellor wrote:
> > > On a tangential note, how are you planning on doing the fallthrough
> > > comment to attribute conversion? The reason I ask is clang does not
> > > support the comment annotations, meaning that when Nathan Huckleberry's
> > > patch is applied to clang (which has been accepted [1]), we are going
> > > to get slammed by the warnings. I just ran an x86 defconfig build at
> > > 296d05cb0d3c with his patch applied and I see 27673 instances of this
> > > warning... (mostly coming from some header files so nothing crazy but it
> > > will be super noisy).
> > >
> > > If you have something to share like a script or patch, I'd be happy to
> > > test it locally.
> > >
> > > [1]: https://reviews.llvm.org/D64838
> >
> > Something like this patch:
> >
> > https://lore.kernel.org/patchwork/patch/1108577/
> >
> > Maybe use:
> >
> > #define fallthrough [[fallthrough]]
>
> Isn't [[fallthrough]] the C++ style attribute? **eek** Seems to be a
It is going to be very likely also the C spelling too, i.e. C2x will
likely be released with attributes. [[fallthrough]] in particular is
still on discussion but it may be included too (thanks Aaron!).
> waste for Clang to implement __attribute__((fallthrough)) just as we
> switch the kernel to not use it. Also, I'd recommend making the
> preprocessor define all caps to help folks recognize it's a
> preprocessor define.
Hm... I would go for either __fallthrough as the rest of attributes,
or simply fallthrough -- FALLTHROUGH seems wrong. If you want it that
way for visibility, then I would choose __fallthrough, since the
underscores are quite prominent and anyway IDEs typically highlight
macros in a different color than keywords (return etc.).
Cheers,
Miguel
Powered by blists - more mailing lists