[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241125-kbuild-c23-extensions-v1-1-b4263b795fc8@weissschuh.net>
Date: Mon, 25 Nov 2024 10:03:00 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Masahiro Yamada <masahiroy@...nel.org>,
Nathan Chancellor <nathan@...nel.org>, Nicolas Schier <nicolas@...sle.eu>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Bill Wendling <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev,
Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH RFC] kbuild: disable -Wc23-extensions from clang
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@...ssschuh.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(+)
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'
---
base-commit: 9f16d5e6f220661f73b36a4be1b21575651d8833
change-id: 20241118-kbuild-c23-extensions-2560d140de36
Best regards,
--
Thomas Weißschuh <linux@...ssschuh.net>
Powered by blists - more mailing lists