[PATCH RFC next 06/18] Makefile: move deprecated-non-prototype to scripts/Makefile.extrawarn.u-boot
Quentin Schulz
foss+uboot at 0leil.net
Mon May 4 15:20:33 CEST 2026
From: Quentin Schulz <quentin.schulz at cherry.de>
This option is specific to U-Boot and was added back in
commit 52ee1a0294e8 ("global: Disable deprecated-non-prototype warning
with clang"). It was added next to other flags which are imported from
the Linux kernel Makefile. This makes it unnecessarily hard to backport
patches from that project since we'll always have a difference in the
git context.
So, move this to the new scripts/Makefile.extrawarn.u-boot file where we
can store everything that is U-Boot-specific and lower the efforts for
syncing with the Linux kernel for Makefile.
Signed-off-by: Quentin Schulz <quentin.schulz at cherry.de>
---
Makefile | 1 -
scripts/Makefile.extrawarn.u-boot | 18 ++++++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index a0e9406bc59..bfd4976a0d4 100644
--- a/Makefile
+++ b/Makefile
@@ -1007,7 +1007,6 @@ KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
# source of a reference will be _MergedGlobals and not on of the whitelisted names.
# See modpost pattern 2
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
-KBUILD_CFLAGS += $(call cc-disable-warning, deprecated-non-prototype)
else
# These warnings generated too much noise in a regular build.
diff --git a/scripts/Makefile.extrawarn.u-boot b/scripts/Makefile.extrawarn.u-boot
index 21872a5492b..0a9b49a30f0 100644
--- a/scripts/Makefile.extrawarn.u-boot
+++ b/scripts/Makefile.extrawarn.u-boot
@@ -7,3 +7,21 @@
ifneq ($(findstring 3, $(KBUILD_EXTRA_WARN)),)
KBUILD_CFLAGS += $(call cc-option, -Wvla)
endif
+
+ifdef CONFIG_CC_IS_CLANG
+# We have a number of places in the code which use the following syntax:
+#
+# void func(a, b, c)
+# int a; /* Does a */
+# something_t *b; /* Pointer to b */
+# int c; /* Does c */
+# {
+# ...
+# }
+#
+# Which while not what we document as our coding style, this is also code
+# which we have imported from other projects, and would like to re-sync
+# with in the future. While the biggest example of this is the zlib code,
+# there are other places as well. For now, we will silence this warning.
+KBUILD_CFLAGS += $(call cc-disable-warning, deprecated-non-prototype)
+endif
--
2.54.0
More information about the U-Boot
mailing list