Re: [PATCH] builtin: mark __builtin_strlen() as integer constant expression
From: Daniel Gomez
Date: Thu Feb 19 2026 - 11:54:09 EST
On 2026-02-19 17:10, Daniel Gomez wrote:
> From: Daniel Gomez <da.gomez@xxxxxxxxxxx>
>
> Commit ae83f3b72621 ("module: Add compile-time check for embedded
> NUL characters") in the Linux kernel added static assert checks for
> __builtin_strlen() inside MODULE_INFO() macros. But sparse does not mark
> the result as CEF_SET_ICE during evaluation, making these assertions
> fail with:
>
> error: static assertion failed: "MODULE_INFO(...) contains embedded
> NUL byte"
>
> Fix by marking __builtin_strlen() as an integer constant expression at
> eval time. This matches other builtins like __builtin_constant_p() or
> __builtin_safe_p().
>
> Signed-off-by: Daniel Gomez <da.gomez@xxxxxxxxxxx>
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: "Luck, Tony" <tony.luck@xxxxxxxxx>
Reported-by: Eric Biggers <ebiggers@xxxxxxxxxx>