Skip to content

Commit e7a1092

Browse files
t-8chnathanchance
authored andcommitted
kbuild: unify W=e and CONFIG_WERROR
The two mechanisms have the same effect, unify their implementation. Also avoid spurious rebuilds when switching between the two. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Nicolas Schier <nsc@kernel.org> Link: https://lore.kernel.org/r/20250814-kbuild-werror-v2-2-c01e596309d2@linutronix.de Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent f852ce0 commit e7a1092

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

scripts/Makefile.extrawarn

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ ifneq ($(CONFIG_FRAME_WARN),0)
2525
KBUILD_CFLAGS += -Wframe-larger-than=$(CONFIG_FRAME_WARN)
2626
endif
2727

28-
KBUILD_CPPFLAGS-$(CONFIG_WERROR) += -Werror
29-
KBUILD_CPPFLAGS += $(KBUILD_CPPFLAGS-y)
3028
KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds
3129

3230
ifdef CONFIG_CC_IS_CLANG
@@ -214,9 +212,9 @@ KBUILD_CFLAGS += -Wno-unused-parameter
214212
endif
215213

216214
#
217-
# W=e - error out on warnings
215+
# W=e and CONFIG_WERROR - error out on warnings
218216
#
219-
ifneq ($(findstring e, $(KBUILD_EXTRA_WARN)),)
217+
ifneq ($(findstring e, $(KBUILD_EXTRA_WARN))$(CONFIG_WERROR),)
220218

221219
KBUILD_CPPFLAGS += -Werror
222220

0 commit comments

Comments
 (0)