[PATCH 0/3] string.h: Use ARRAY_SIZE() for memtostr*()/strtomem*()

From: Kees Cook
Date: Thu Feb 06 2025 - 13:12:20 EST


Work around a Clang 14 bug by switching to ARRAY_SIZE() (with the
added benefit of explicitly checking for char array arguments) in
memtostr*/strtomem*().

-Kees

Kees Cook (3):
compiler.h: Move C string helpers into C-only kernel section
compiler.h: Introduce __must_be_char_array()
string.h: Use ARRAY_SIZE() for memtostr*()/strtomem*()

include/linux/compiler.h | 32 +++++++++++++++++++-------------
include/linux/string.h | 12 ++++++++----
2 files changed, 27 insertions(+), 17 deletions(-)

--
2.34.1