linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Alan Cox <gnomes@lxorguk.ukuu.org.uk>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] x86/syscalls: Mark expected switch fall-throughs
Date: Tue, 28 Nov 2017 14:25:32 -0600	[thread overview]
Message-ID: <20171128142532.Horde.i2oBtHDOaD7XV1M3yAL7rga@gator4166.hostgator.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1711282109060.2222@nanos>


Quoting Thomas Gleixner <tglx@linutronix.de>:

> On Tue, 28 Nov 2017, Alan Cox wrote:
>
>> > I have no idea who came up with that brilliant idea of parsing comments in
>> > the code. It's so simple to make this parser completely fail that it's not
>>
>> Stephen Johnson (author of the V7 portable C compiler), which is where
>> it's from (the lint tool). He also wrote yacc so he does know a bit about
>> parsers 8).
>
> I don't doubt that.
>
>> > even funny anymore.
>>
>> The notation in question has been standard in tools like lint since the
>> end of the 1970s
>
> Fair enough.
>
> Still that does not make the GCC implementation which defaults to take 'any
> comment' as valid any better and does not solve other parsing issues which
> have been pointed out in various GCC bugs. Using the macro annotation is
> distinct and has no ifs and buts.
>

The thing about taking 'any comment' as valid is false if you add the  
following to your Makefile:

KBUILD_CFLAGS  += $(call cc-option,-Wimplicit-fallthrough)

This option takes the following comments as valid:

/* fall through */
/* Fall through */
/* fall through - ... */
/* Fall through - ... */

Comments as fallthru, fallthrough, FALLTHRU are invalid.

And of course if you intentionally change the option to:

KBUILD_CFLAGS  += $(call cc-option,-Wimplicit-fallthrough=1)

it means that you obviously want to ignore any warning.

Thanks
--
Gustavo A. R. Silva

  reply	other threads:[~2017-11-28 20:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 23:52 [PATCH] x86/syscalls: Mark expected switch fall-throughs Gustavo A. R. Silva
2017-11-28 13:49 ` Thomas Gleixner
2017-11-28 18:05   ` Gustavo A. R. Silva
2017-11-28 18:10     ` Thomas Gleixner
2017-11-28 18:17       ` Thomas Gleixner
2017-11-28 18:22         ` Gustavo A. R. Silva
2017-11-28 18:27           ` Thomas Gleixner
2017-11-28 18:35             ` Thomas Gleixner
2017-11-28 18:45               ` Thomas Gleixner
2017-11-28 18:53                 ` Gustavo A. R. Silva
2017-11-28 19:48                   ` Thomas Gleixner
2017-11-28 19:00               ` Alan Cox
2017-11-28 19:10                 ` Linus Torvalds
2017-11-28 19:59                   ` Joe Perches
2017-11-28 20:08                   ` Thomas Gleixner
2017-11-28 20:34                     ` Kees Cook
2017-11-28 20:37                   ` Gustavo A. R. Silva
2017-11-29  1:07                     ` Joe Perches
2017-11-29  8:20                       ` Geert Uytterhoeven
2017-11-28 20:11                 ` Thomas Gleixner
2017-11-28 20:25                   ` Gustavo A. R. Silva [this message]
2017-11-28 21:25                     ` Thomas Gleixner
2017-11-29 15:10                       ` Gustavo A. R. Silva
2017-11-29 15:14                         ` Thomas Gleixner
2017-11-30  0:21                           ` Kees Cook
2019-01-29 23:56 Gustavo A. R. Silva
2019-01-30  0:14 ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171128142532.Horde.i2oBtHDOaD7XV1M3yAL7rga@gator4166.hostgator.com \
    --to=garsilva@embeddedor.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).