From: Ahmad Fatoum <[email protected]> clang warns about the intentional [0 ... N] = default followed by per-entry overrides, e.g. in arch/arm/cpu/interrupts_64.c:
arch/arm/cpu/interrupts_64.c:28:26: error: initializer overrides prior initialization of this subobject [-Werror,-Winitializer-overrides] Disable it for clang, as Linux does. Assisted-by: Claude:fable-5 Signed-off-by: Ahmad Fatoum <[email protected]> --- scripts/Makefile.warn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/Makefile.warn b/scripts/Makefile.warn index 393f7fd522c8..237597d18af4 100644 --- a/scripts/Makefile.warn +++ b/scripts/Makefile.warn @@ -47,6 +47,9 @@ KBUILD_CFLAGS += -Wno-pointer-sign # them when -Wall is passed later on the command line, so the -Wno... options # must come after -Wall KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) +ifdef CONFIG_CC_IS_CLANG +KBUILD_CFLAGS += -Wno-initializer-overrides +endif # # W=e and CONFIG_WERROR - error out on warnings -- 2.47.3
