Re: [PATCH] x86/syscalls: Mark expected switch fall-throughs

From: Thomas Gleixner
Date: Tue Nov 28 2017 - 15:09:03 EST


On Tue, 28 Nov 2017, Linus Torvalds wrote:

> On Tue, Nov 28, 2017 at 11:00 AM, Alan Cox <gnomes@xxxxxxxxxxxxxxxxxxx> wrote:
> >
> > The notation in question has been standard in tools like lint since the
> > end of the 1970s
>
> Yes.
>
> That said, maybe one option would be to annotate the "case:" and
> "default:" statements if that makes people happier.
>
> IOW, we could do something like
>
> #define fallthrough __atttibute__((fallthrough))
>
> and then write
>
> fallthrough case 1:
> ...
>
> which while absolutely not traditional, might look and read a bit more
> logical to people. I mean, it literally _is_ a "fallthrough case", so
> it makes semantic sense.
>
> Or maybe people hate that kind of "making up new syntax" too?

Fine with me. Better than any comment.

Thanks,

tglx