Skip to content

Commit c152534

Browse files
committed
kbuild: move -fzero-init-padding-bits=all to the top-level Makefile
The -fzero-init-padding-bits=all option is not a warning flag, so defining it in scripts/Makefile.extrawarn is inconsistent. Move it to the top-level Makefile for consistency. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Reviewed-by: Kees Cook <[email protected]>
1 parent 9d702bb commit c152534

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,9 @@ KBUILD_CFLAGS += $(CC_AUTO_VAR_INIT_ZERO_ENABLER)
928928
endif
929929
endif
930930

931+
# Explicitly clear padding bits during variable initialization
932+
KBUILD_CFLAGS += $(call cc-option,-fzero-init-padding-bits=all)
933+
931934
# While VLAs have been removed, GCC produces unreachable stack probes
932935
# for the randomize_kstack_offset feature. Disable it for all compilers.
933936
KBUILD_CFLAGS += $(call cc-option, -fno-stack-clash-protection)

scripts/Makefile.extrawarn

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init)
8282
# Warn if there is an enum types mismatch
8383
KBUILD_CFLAGS += $(call cc-option,-Wenum-conversion)
8484

85-
# Explicitly clear padding bits during variable initialization
86-
KBUILD_CFLAGS += $(call cc-option,-fzero-init-padding-bits=all)
87-
8885
KBUILD_CFLAGS += -Wextra
8986
KBUILD_CFLAGS += -Wunused
9087

0 commit comments

Comments
 (0)