Skip to contentSkip to conversation

kbuild: Fix -Wimplicit-fallthrough=5 error for GCC 5.x and 6.x

PATCH Superseded Gustavo A. R. Silva 1 participant 1 message Nov 15, 2021 Kbuild

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kbuild: Fix -Wimplicit-fallthrough=5 error for GCC 5.x and 6.x

-Wimplicit-fallthrough=5 was under cc-option because it was only available in GCC 7.x and newer so the build is now broken for GCC 5.x and 6.x:

gcc: error: unrecognized command line option '-Wimplicit-fallthrough=5'; did you mean '-Wno-fallthrough'?

Fix this by moving -Wimplicit-fallthrough=5 under cc-option.

Fixes dee2b702bcf0 ("kconfig: Add support for -Wimplicit-fallthrough")

---
Changes in v2:
- Add Fixes tag.

 init/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
init/Kconfig +1 -1
index 036b750e8d8a..85882c317235 100644
@@ -887,7 +887,7 @@ config CC_HAS_INT128
 
 config CC_IMPLICIT_FALLTHROUGH
 	string
-	default "-Wimplicit-fallthrough=5" if CC_IS_GCC
+	default "-Wimplicit-fallthrough=5" if $(cc-option,-Wimplicit-fallthrough=5)
 	default "-Wimplicit-fallthrough" if CC_IS_CLANG && $(cc-option,-Wunreachable-code-fallthrough)
 
 #
Signature · 1 line
2.27.0