Message ID | 20241125-kbuild-c23-extensions-v1-1-b4263b795fc8@weissschuh.net (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [RFC] kbuild: disable -Wc23-extensions from clang | expand |
diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index 1d13cecc7cc7808610e635ddc03476cf92b3a8c1..0da75c9d84da4daf6936495a5ab96df75658da4f 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -31,6 +31,8 @@ KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds ifdef CONFIG_CC_IS_CLANG # The kernel builds with '-std=gnu11' so use of GNU extensions is acceptable. KBUILD_CFLAGS += -Wno-gnu +# Some allowed GNU extensions are also C23 extensions +KBUILD_CFLAGS += $(call cc-disable-warning, c23-extensions) else # gcc inanely warns about local variables called 'main'
Some of the C23 extensions are also GNU extensions, which are allowed. Examples are declarations after labels or function definitions with omitted parameter names. Also with the switch to C23 at some point in the future all those warnings will be resolved automatically anyways. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> --- I had some patches failing the CI only with clang. And it feels like unnecessary busywork to fix these warnings. --- scripts/Makefile.extrawarn | 2 ++ 1 file changed, 2 insertions(+) --- base-commit: 9f16d5e6f220661f73b36a4be1b21575651d8833 change-id: 20241118-kbuild-c23-extensions-2560d140de36 Best regards,