llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Deal with clang's -Wdefault-const-init-unsafe
@ 2025-05-01 23:00 Nathan Chancellor
  2025-05-01 23:00 ` [PATCH 1/2] kbuild: Disable -Wdefault-const-init-field-unsafe Nathan Chancellor
  2025-05-01 23:00 ` [PATCH 2/2] include/linux/typecheck.h: Zero initialize dummy variables Nathan Chancellor
  0 siblings, 2 replies; 13+ messages in thread
From: Nathan Chancellor @ 2025-05-01 23:00 UTC (permalink / raw)
  To: Andrew Morton, Masahiro Yamada
  Cc: Nicolas Schier, Andrew Morton, Nick Desaulniers, Bill Wendling,
	Justin Stitt, Linus Torvalds, linux-kbuild, linux-kernel, llvm,
	patches, stable, Linux Kernel Functional Testing, Marcus Seyfarth,
	Nathan Chancellor

A new on by default warning in clang aims to flag cases where a const
variable or field is not initialized and has no default value (i.e., not
static or thread local). The field version of the warning triggers in
several places within the kernel that are not problematic so it is
disabled in the first patch. The variable version of the warning only
triggers in one place, the typecheck() macro, so I opted to silence it
in that one place to keep it enabled until it can be proved to be
problematic enough to disable it.

---
Nathan Chancellor (2):
      kbuild: Disable -Wdefault-const-init-field-unsafe
      include/linux/typecheck.h: Zero initialize dummy variables

 include/linux/typecheck.h  | 4 ++--
 scripts/Makefile.extrawarn | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)
---
base-commit: ebd297a2affadb6f6f4d2e5d975c1eda18ac762d
change-id: 20250430-default-const-init-clang-b6e21b8d03b6

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


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

end of thread, other threads:[~2025-05-09 13:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-01 23:00 [PATCH 0/2] Deal with clang's -Wdefault-const-init-unsafe Nathan Chancellor
2025-05-01 23:00 ` [PATCH 1/2] kbuild: Disable -Wdefault-const-init-field-unsafe Nathan Chancellor
2025-05-09 13:02   ` Masahiro Yamada
2025-05-01 23:00 ` [PATCH 2/2] include/linux/typecheck.h: Zero initialize dummy variables Nathan Chancellor
2025-05-01 23:28   ` Linus Torvalds
2025-05-01 23:37     ` Linus Torvalds
2025-05-02  0:28     ` Al Viro
2025-05-02  1:24     ` Nathan Chancellor
2025-05-02  1:34       ` Linus Torvalds
2025-05-02  2:09         ` Nathan Chancellor
2025-05-02  2:05       ` Al Viro
2025-05-02  2:36         ` Nathan Chancellor
2025-05-02  9:46   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).