Re: [PATCH] builtin: mark __builtin_strlen() as integer constant expression
Sami Tolvanen <[email protected]> Thu, 19 Feb 2026 08:41:16 -0800
| Newsgroups | org.kernel.vger.linux-sparse,org.kernel.vger.linux-kernel,org.kernel.vger.linux-modules |
|---|---|
| Message-ID | <CABCJKuf8jh_yxQcR1=uMeuWOueXyoM5=L-QpTuBenRi_MZK_Gg@mail.gmail.com> |
Hi Daniel, On Thu, Feb 19, 2026 at 8:11=E2=80=AFAM Daniel Gomez <[email protected]> = wrote: > > From: Daniel Gomez <[email protected]> > > 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 <[email protected]> > --- > Discussion: > https://lore.kernel.org/all/aTc9s210am0YqMV4@agluck-desk3/ It looks like Al had a more complete fix for this issue, but I guess it never ended up in the sparse repo? https://lore.kernel.org/all/aUV7kyjxlijuy5sC@agluck-desk3/ Sami