Skip to content

Commit 2c1460d

Browse files
arndbakpm00
authored andcommitted
kbuild: remove redundant extra warning flags
There is no point in turning individual options off and then on again, or vice versa, as the last one always wins. Now that -Wextra always gets passed first, remove all the redundant lines about warnings that are implied by either -Wall or -Wextra, and keep only the last one that disables it in some configurations. This should not have any effect but keep the Makefile more readable and the command line shorter. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]> Cc: Kees Cook <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Nicolas Schier <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent f5982cc commit 2c1460d

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

scripts/Makefile.extrawarn

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ else
3737
KBUILD_CFLAGS += -Wno-main
3838
endif
3939

40-
# These warnings generated too much noise in a regular build.
41-
# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
42-
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
43-
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
44-
4540
# These result in bogus false positives
4641
KBUILD_CFLAGS += $(call cc-disable-warning, dangling-pointer)
4742

@@ -90,16 +85,9 @@ KBUILD_CFLAGS += -Wunused
9085
#
9186
ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),)
9287

93-
KBUILD_CFLAGS += $(call cc-option, -Wrestrict)
9488
KBUILD_CFLAGS += -Wmissing-format-attribute
95-
KBUILD_CFLAGS += -Wold-style-definition
9689
KBUILD_CFLAGS += -Wmissing-include-dirs
97-
KBUILD_CFLAGS += $(call cc-option, -Wunused-but-set-variable)
9890
KBUILD_CFLAGS += $(call cc-option, -Wunused-const-variable)
99-
KBUILD_CFLAGS += $(call cc-option, -Wpacked-not-aligned)
100-
KBUILD_CFLAGS += $(call cc-option, -Wformat-overflow)
101-
KBUILD_CFLAGS += $(call cc-option, -Wformat-truncation)
102-
KBUILD_CFLAGS += $(call cc-option, -Wstringop-truncation)
10391

10492
KBUILD_CPPFLAGS += -Wundef
10593
KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN1
@@ -150,9 +138,6 @@ ifneq ($(findstring 2, $(KBUILD_EXTRA_WARN)),)
150138
KBUILD_CFLAGS += -Wdisabled-optimization
151139
KBUILD_CFLAGS += -Wshadow
152140
KBUILD_CFLAGS += $(call cc-option, -Wlogical-op)
153-
KBUILD_CFLAGS += -Wmissing-field-initializers
154-
KBUILD_CFLAGS += -Wtype-limits
155-
KBUILD_CFLAGS += $(call cc-option, -Wmaybe-uninitialized)
156141
KBUILD_CFLAGS += $(call cc-option, -Wunused-macros)
157142

158143
KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN2

0 commit comments

Comments
 (0)