Re: [PATCH 0/4] fix build warnings on gcc-16 and glibc-2.43

Dan Carpenter <[email protected]>
Newsgroups org.kernel.vger.smatch
Message-ID <[email protected]>
Thanks,  I applied this to the devel branch of Smatch.

https://github.com/error27/smatch/tree/devel

On Fri, Aug 14, 2026 at 04:09:50PM +0900, Arka Mondal wrote:
> Smatch builds with 14 warnings on gcc-16 and glibc-2.43.  This fixes 12.
> Only the last patch changes behavior: it returns instead of storing a
> truncated name.
> 
> Six of these are new. glibc-2.43 returns const from strchr() and strstr()
> on const strings, and gcc-15 defaults to -std=gnu23 which enables it.
> 
> Two are left.  assume_indexes_are_valid() is unused because its add_hook()
> call is commented out.
> 
> The other is in smatch_kernel_user_data.c:
> 
>       if (param_data_treat_untagged(value) || sym->ctype.as == 5)
> 
> ctype.as is a struct ident pointer, so this is never true.  It has never
> worked: ctype.as became an ident in 69fce9f7 (Dec 2018), this code in 5f2fcd8a (Oct
> 2019).  Revive the check or delete the condition?

I didn't write that code and I did ask about it but I'm not sure what
was intended really...  I've deleted it, since it hopefully can't
possibly be true...  I'll push that later.

(I worry that there is an reason for that weird condition.  Perhaps it
was a hack around for memory corruption or something. :P  But surely all
those ancient bugs have been replaced with new bugs by now).

regards,
dan carpenter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.