build: add -Wno-override-init
Paolo Bonzini
maintainerPATCH 1/1 build: add -Wno-override-init
The -Woverride-init flag (also known as -Winitializer-overrides in clang, but it supports both spellings) warns about code that may be intentional or not. While the unintentional ones tend to be real bugs, overall the idea of overriding function pointers is more useful than the warning.
--- Makefile | 2 ++ 1 file changed, 2 insertions(+)
Makefile +2 -0
@@ -76,6 +76,7 @@ wclobbered := $(call cc-option, -Wclobbered, "") wunused_but_set_parameter := $(call cc-option, -Wunused-but-set-parameter, "") wmissing_parameter_type := $(call cc-option, -Wmissing-parameter-type, "") wold_style_declaration := $(call cc-option, -Wold-style-declaration, "") +wno_override_init := $(call cc-option, -Wno-override-init, "") COMMON_CFLAGS += $(fomit_frame_pointer) COMMON_CFLAGS += $(fno_stack_protector)
@@ -89,6 +90,7 @@ COMMON_CFLAGS += $(fno_pic) endif COMMON_CFLAGS += $(wclobbered) COMMON_CFLAGS += $(wunused_but_set_parameter) +COMMON_CFLAGS += $(wno_override_init) CFLAGS += $(COMMON_CFLAGS) CFLAGS += $(wmissing_parameter_type)
Signature · 1 line
2.54.0
Quoted 6 lines · Paolo Bonzini
The -Woverride-init flag (also known as -Winitializer-overrides in clang, but it supports both spellings) warns about code that may be intentional or not. While the unintentional ones tend to be real bugs, overall the idea of overriding function pointers is more useful than the warning.
Cc f4c5838c ("svm: add basic GMET tests", 2026-05-12)
That should be "Fixes:" instead of "Cc:"
Quoted 1 line
Reviewed-by Thomas Huth <[email protected]>
And that "Reported-by" instead of "Reviewed-by".
Anyway, with these nits fixed:
Thanks!
Quoted 25 lines
Signed-off-by Paolo Bonzini <[email protected]>--- Makefile | 2 ++ 1 file changed, 2 insertions(+)Makefile +2
-0@@ -76,6 +76,7 @@ wclobbered := $(call cc-option, -Wclobbered, "") wunused_but_set_parameter := $(call cc-option, -Wunused-but-set-parameter, "") wmissing_parameter_type := $(call cc-option, -Wmissing-parameter-type, "") wold_style_declaration := $(call cc-option, -Wold-style-declaration, "") +wno_override_init := $(call cc-option, -Wno-override-init, "") COMMON_CFLAGS += $(fomit_frame_pointer) COMMON_CFLAGS += $(fno_stack_protector)@@ -89,6 +90,7 @@ COMMON_CFLAGS += $(fno_pic) endif COMMON_CFLAGS += $(wclobbered) COMMON_CFLAGS += $(wunused_but_set_parameter) +COMMON_CFLAGS += $(wno_override_init) CFLAGS += $(COMMON_CFLAGS) CFLAGS += $(wmissing_parameter_type)
Quoted 10 lines · Thomas Huth
Quoted 6 lines · Paolo Bonzini
The -Woverride-init flag (also known as -Winitializer-overrides in clang, but it supports both spellings) warns about code that may be intentional or not. While the unintentional ones tend to be real bugs, overall the idea of overriding function pointers is more useful than the warning.
Cc f4c5838c ("svm: add basic GMET tests", 2026-05-12)That should be "Fixes:" instead of "Cc:"
Quoted 8 lines
Quoted 1 line
Reviewed-by Thomas Huth <[email protected]>And that "Reported-by" instead of "Reviewed-by".
Anyway, with these nits fixed:
Tested-by Thomas Huth <[email protected]>Thanks!
I've pushed it to the repo, and together with the other fixes, the CI is finally green again:
https://gitlab.com/kvm-unit-tests/kvm-unit-tests/-/pipelines/2539893859
Thomas