Skip to contentSkip to conversation

kbuild: move -fzero-init-padding-bits=all to the top-level Makefile

PATCH In review Masahiro Yamada 3 participants 3 messages Feb 15, 2025 – Feb 16, 2025 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

 Makefile                   | 3 +++
 scripts/Makefile.extrawarn | 3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)
Makefile +3 -0
index 89628e354ca7..4a36864dd4bd 100644
@@ -928,6 +928,9 @@ KBUILD_CFLAGS	+= $(CC_AUTO_VAR_INIT_ZERO_ENABLER)
 endif
 endif
 
+# Explicitly clear padding bits during variable initialization
+KBUILD_CFLAGS += $(call cc-option,-fzero-init-padding-bits=all)
+
 # While VLAs have been removed, GCC produces unreachable stack probes
 # for the randomize_kstack_offset feature. Disable it for all compilers.
 KBUILD_CFLAGS	+= $(call cc-option, -fno-stack-clash-protection)
scripts/Makefile.extrawarn +0 -3
index dc081cf46d21..d75897559d18 100644
@@ -82,9 +82,6 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init)
 # Warn if there is an enum types mismatch
 KBUILD_CFLAGS += $(call cc-option,-Wenum-conversion)
 
-# Explicitly clear padding bits during variable initialization
-KBUILD_CFLAGS += $(call cc-option,-fzero-init-padding-bits=all)
-
 KBUILD_CFLAGS += -Wextra
 KBUILD_CFLAGS += -Wunused
 
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Masahiro Yamada

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.

Whoops, I will have to watch for that in the future.

Quoted 37 lines

---

 Makefile                   | 3 +++
 scripts/Makefile.extrawarn | 3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)
Makefile +3 -0
index 89628e354ca7..4a36864dd4bd 100644
@@ -928,6 +928,9 @@ KBUILD_CFLAGS	+= $(CC_AUTO_VAR_INIT_ZERO_ENABLER)
 endif
 endif
 
+# Explicitly clear padding bits during variable initialization
+KBUILD_CFLAGS += $(call cc-option,-fzero-init-padding-bits=all)
+
 # While VLAs have been removed, GCC produces unreachable stack probes
 # for the randomize_kstack_offset feature. Disable it for all compilers.
 KBUILD_CFLAGS	+= $(call cc-option, -fno-stack-clash-protection)
scripts/Makefile.extrawarn +0 -3
index dc081cf46d21..d75897559d18 100644
@@ -82,9 +82,6 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init)
 # Warn if there is an enum types mismatch
 KBUILD_CFLAGS += $(call cc-option,-Wenum-conversion)
 
-# Explicitly clear padding bits during variable initialization
-KBUILD_CFLAGS += $(call cc-option,-fzero-init-padding-bits=all)
-
 KBUILD_CFLAGS += -Wextra
 KBUILD_CFLAGS += -Wunused
 
Signature · 1 line
2.43.0