Skip to contentSkip to conversation

Makefile: 'Promote' -Wunused-but-set-variable to W=3

PATCH In review Peter Zijlstra 2 participants 2 messages Sep 11, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: 'Promote' -Wunused-but-set-variable to W=3

Upgrade -Wunused-but-set-variable to W=3 to avoid the build robots sending endless spam for this garbage warning.

By promoting it to W=3 the robots will no longer report it and people will no longer attempt to fix them by making the code worse.

---

scripts/Makefile.extrawarn +1 -1
index d53825503874..6686cc587d3b 100644
@@ -28,7 +28,6 @@ KBUILD_CFLAGS += -Wmissing-format-attribute
 KBUILD_CFLAGS += -Wmissing-prototypes
 KBUILD_CFLAGS += -Wold-style-definition
 KBUILD_CFLAGS += -Wmissing-include-dirs
-KBUILD_CFLAGS += $(call cc-option, -Wunused-but-set-variable)
 KBUILD_CFLAGS += $(call cc-option, -Wunused-const-variable)
 KBUILD_CFLAGS += $(call cc-option, -Wpacked-not-aligned)
 KBUILD_CFLAGS += $(call cc-option, -Wstringop-truncation)
@@ -88,6 +87,7 @@ KBUILD_CFLAGS += -Wredundant-decls
 KBUILD_CFLAGS += -Wsign-compare
 KBUILD_CFLAGS += -Wswitch-default
 KBUILD_CFLAGS += $(call cc-option, -Wpacked-bitfield-compat)
+KBUILD_CFLAGS += $(call cc-option, -Wunused-but-set-variable)
 
 KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN3
 
#1 lore raw
Quoted 2 lines · Peter Zijlstra

Upgrade -Wunused-but-set-variable to W=3 to avoid the build robots sending endless spam for this garbage warning.

"This warning for garbage code" you mean?

Quoted 2 lines

By promoting it to W=3 the robots will no longer report it and people will no longer attempt to fix them by making the code worse.

Instead, they will not see such warnings, and make the code worse.

Segher