From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Michal Suchanek <msuchanek@suse.de>, linux-kbuild@vger.kernel.org
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
Michal Marek <michal.lkml@markovi.net>,
linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] Makefile: Convert -Wimplicit-fallthrough to -Wimplicit-fallthrough=2
Date: Sat, 31 Aug 2019 00:12:10 -0500 [thread overview]
Message-ID: <975cea02-a2db-c0b9-ba84-83a0ddadab0f@embeddedor.com> (raw)
In-Reply-To: <20190829120215.1977-1-msuchanek@suse.de>
On 8/29/19 7:02 AM, Michal Suchanek wrote:
> From gcc documentation:
>
> -Wimplicit-fallthrough=0
> disables the warning altogether.
> -Wimplicit-fallthrough=1
> matches .* regular expression, any comment is used as fallthrough comment.
> -Wimplicit-fallthrough=2
> case insensitively matches .*falls?[ \t-]*thr(ough|u).* regular expression.
> -Wimplicit-fallthrough=3
> case sensitively matches one of the following regular expressions:
> -fallthrough
> @fallthrough@
> lint -fallthrough[ \t]*
> [ \t.!]*(ELSE,? |INTENTIONAL(LY)? )?
> FALL(S | |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)?
> [ \t.!]*(Else,? |Intentional(ly)? )?
> Fall((s | |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)?
> [ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )?
> fall(s | |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?
> -Wimplicit-fallthrough=4
> case sensitively matches one of the following regular expressions:
> -fallthrough
> @fallthrough@
> lint -fallthrough[ \t]*
> [ \t]*FALLTHR(OUGH|U)[ \t]*
> -Wimplicit-fallthrough=5
> doesn’t recognize any comments as fallthrough comments, only attributes disable the warning.
>
> In particular the default value of 3 does not match the comments like
> /* falls through to do foobar */
> generating suprious warnings on properly annotated code.
>
NACK
How many of those case do you see? if any...
In any case, those comments can be easily transformed to:
/* falls through - to do foobar */
like in this case:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d2d833e0bf2bad221a955626b942b38312630894
Also, notice that code in linux-next is already ahead... :
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=e2079e93f562c7f7a030eb7642017ee5eabaaa10
--
Gustavo
prev parent reply other threads:[~2019-08-31 5:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-29 12:02 [PATCH] Makefile: Convert -Wimplicit-fallthrough to -Wimplicit-fallthrough=2 Michal Suchanek
2019-08-30 11:09 ` Joe Perches
2019-08-30 12:12 ` Miguel Ojeda
2019-08-31 5:12 ` Gustavo A. R. Silva [this message]
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=975cea02-a2db-c0b9-ba84-83a0ddadab0f@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=keescook@chromium.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=msuchanek@suse.de \
--cc=yamada.masahiro@socionext.com \
/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