LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Nathan Chancellor <nathan@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Philip Li <philip.li@intel.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH] kbuild: Enable -Wimplicit-fallthrough for clang 14.0.0+
Date: Tue, 17 Aug 2021 18:40:25 -0500	[thread overview]
Message-ID: <1f05cd38-c576-0ded-81b6-fe0b49a5059e@embeddedor.com> (raw)
In-Reply-To: <72ae69b4-6069-ade5-a12b-8ee0435f803a@kernel.org>



On 8/17/21 18:23, Nathan Chancellor wrote:
>>>> # Warn about unmarked fall-throughs in switch statement.
>>>> # Clang prior to 14.0.0 warned on unreachable fallthroughs with
>>>> # -Wimplicit-fallthrough, which is unacceptable due to IS_ENABLED().
>>>> # https://bugs.llvm.org/show_bug.cgi?id=51094
>>>> ifeq ($(firstword $(sort $(CONFIG_CLANG_VERSION) 140000)),140000)
>>>> KBUILD_CFLAGS += -Wimplicit-fallthrough
>>>> endif
> 
> Very clever and nifty trick! I have verified that it works for clang 13 and 14 along with a theoretical clang 15. Gustavo, feel free to stick a
> 
> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> Tested-by: Nathan Chancellor <nathan@kernel.org>
> 
> if you so desire.

Yep; I just tested it locally with clang 13 and 14, too.

Thanks
--
Gustavo



  reply	other threads:[~2021-08-17 23:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17  0:56 Nathan Chancellor
2021-08-17  4:16 ` kernel test robot
2021-08-17  4:20 ` Nathan Chancellor
2021-08-17  4:37   ` Linus Torvalds
2021-08-17  4:55     ` Nathan Chancellor
2021-08-17 18:03       ` Kees Cook
2021-08-17 18:25         ` Nathan Chancellor
2021-08-17 21:17           ` Masahiro Yamada
2021-08-17 21:33             ` Gustavo A. R. Silva
2021-08-17 23:06               ` Kees Cook
2021-08-17 23:23                 ` Nathan Chancellor
2021-08-17 23:40                   ` Gustavo A. R. Silva [this message]
2021-08-18  4:15                   ` Masahiro Yamada
2021-08-18  4:27                   ` Philip Li
2021-08-18  4:45                     ` Gustavo A. R. Silva
2021-08-18  7:31                       ` Philip Li
2021-08-18 12:12                   ` Mark Brown
2021-08-25 21:09             ` Nick Desaulniers

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=1f05cd38-c576-0ded-81b6-fe0b49a5059e@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=gustavoars@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=philip.li@intel.com \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: [PATCH] kbuild: Enable -Wimplicit-fallthrough for clang 14.0.0+' \
    /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

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).