mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Makefile.extrawarn: Move -Wcast-function-type-strict to W=1
@ 2022-09-30 20:33 Sami Tolvanen
  2022-10-01 14:48 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Sami Tolvanen @ 2022-09-30 20:33 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: Nick Desaulniers, Nathan Chancellor, Tom Rix, linux-kbuild,
	linux-kernel, llvm, Kees Cook, Sami Tolvanen, stable

We enable -Wcast-function-type globally in the kernel to warn about
mismatching types in function pointer casts. Compilers currently
warn only about ABI incompability with this flag, but Clang 16 will
enable a stricter version of the check by default that checks for an
exact type match. This will be very noisy in the kernel, so disable
-Wcast-function-type-strict without W=1 until the new warnings have
been addressed.

Cc: stable@vger.kernel.org
Link: https://reviews.llvm.org/D134831
Link: https://github.com/ClangBuiltLinux/linux/issues/1724
Suggested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
---
 scripts/Makefile.extrawarn | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index 6ae482158bc4..52bd7df84fd6 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -64,6 +64,7 @@ KBUILD_CFLAGS += -Wno-sign-compare
 KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast)
 KBUILD_CFLAGS += -Wno-tautological-constant-out-of-range-compare
 KBUILD_CFLAGS += $(call cc-disable-warning, unaligned-access)
+KBUILD_CFLAGS += $(call cc-disable-warning, cast-function-type-strict)
 endif
 
 endif

base-commit: 7bc6e90d7aa4170039abe80b9f4e8c8e4eb35091
-- 
2.38.0.rc1.362.ged0d419d3c-goog


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-01 14:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-30 20:33 [PATCH] Makefile.extrawarn: Move -Wcast-function-type-strict to W=1 Sami Tolvanen
2022-10-01 14:48 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®