diff mbox series

Kbuild: enable -Wfallthrough for clang

Message ID 20201107070744.1133811-1-ndesaulniers@google.com (mailing list archive)
State New
Headers show
Series Kbuild: enable -Wfallthrough for clang | expand

Commit Message

Nick Desaulniers Nov. 7, 2020, 7:07 a.m. UTC
Partial revert of commit e2079e93f562 ("kbuild: Do not enable
-Wimplicit-fallthrough for clang for now")

This has been fixed up over time thanks to the addition of "fallthrough"
pseudo-keyword in
commit 294f69e662d1 ("compiler_attributes.h: Add 'fallthrough' pseudo
keyword for switch/case use")

Link: https://github.com/ClangBuiltLinux/linux/issues/236
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
 Makefile | 5 -----
 1 file changed, 5 deletions(-)

Comments

Miguel Ojeda Nov. 7, 2020, 8:07 a.m. UTC | #1
On Sat, Nov 7, 2020 at 8:08 AM Nick Desaulniers <ndesaulniers@google.com> wrote:
>
> Partial revert of commit e2079e93f562 ("kbuild: Do not enable
> -Wimplicit-fallthrough for clang for now")
>
> This has been fixed up over time thanks to the addition of "fallthrough"
> pseudo-keyword in
> commit 294f69e662d1 ("compiler_attributes.h: Add 'fallthrough' pseudo
> keyword for switch/case use")

I think the title is missing the "implicit"?

Acked-by: Miguel Ojeda <ojeda@kernel.org>

Cheers,
Miguel
Miguel Ojeda Nov. 7, 2020, 11:17 a.m. UTC | #2
On Sat, Nov 7, 2020 at 8:08 AM Nick Desaulniers <ndesaulniers@google.com> wrote:
>
> Partial revert of commit e2079e93f562 ("kbuild: Do not enable
> -Wimplicit-fallthrough for clang for now")

Wait, it says partial revert because it is one, but doing it this way
does not enable the option back for GCC (and Clang).

Shouldn't it be a full revert?

Cheers,
Miguel
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index f353886dbf44..c1c61c276f60 100644
--- a/Makefile
+++ b/Makefile
@@ -777,11 +777,6 @@  else
 # These warnings generated too much noise in a regular build.
 # Use make W=1 to enable them (see scripts/Makefile.extrawarn)
 KBUILD_CFLAGS += -Wno-unused-but-set-variable
-
-# Warn about unmarked fall-throughs in switch statement.
-# Disabled for clang while comment to attribute conversion happens and
-# https://github.com/ClangBuiltLinux/linux/issues/636 is discussed.
-KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,)
 endif
 
 KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)