Re: [PATCH] sparse/pre-process: introduce "dissect_mode" option to fix dissect/semind

Oleg Nesterov <[email protected]> Mon, 19 Jan 2026 13:32:56 +0100
Newsgroups org.kernel.vger.linux-sparse
Message-ID <[email protected]>
On 01/18, Chris Li wrote:
>
> On Sat, Jan 17, 2026 at 8:32 AM Oleg Nesterov <[email protected]> wrote:
> >
> > On a 2nd thought...
> >
> > Unlike other warnings, this one (sizeof-void.c:20:27) refers to the
> > inner "sizeof *ptr", so I think that this patch fixes the reported
> > position. So yes, I think we don't care even if the new column == 27
> > differs from other warnings.
> >
> > What do you think?
>
> I would just update the checker to have the new expected value
> matching what new pos so validation can pass without errors.

Yes, this is what I did. See

	[PATCH] sparse/pre-process: don't update next->pos in collect_arg()
	https://lore.kernel.org/all/[email protected]/

I was confused and tried to confuse you... let me explain. With this patch
./sparse -Wpointer-arith validation/sizeof-void.c outputs

	validation/sizeof-void.c:16:14: warning: expression using sizeof(void)
	validation/sizeof-void.c:17:14: warning: expression using sizeof(void)
	validation/sizeof-void.c:18:14: warning: expression using sizeof(void)
	validation/sizeof-void.c:19:14: warning: expression using sizeof(void)
	validation/sizeof-void.c:20:27: warning: expression using sizeof(void) // changed
	validation/sizeof-void.c:21:14: warning: expression using sizeof(void)
	validation/sizeof-void.c:22:14: warning: expression using sizeof(void)
	validation/sizeof-void.c:23:14: warning: expression using sizeof(void)

and somehow I wrongly came to conlusion that my patch is incomplete or
inconsistent because it only corrects the warning's position for the
line 20.

Now that I actually looked at validation/sizeof-void.c, I see that the
code at line 20

	s += is_constexpr(sizeof *ptr);

differs in that it is the inner "sizeof *ptr" which triggers the warning,
so I think the patch is fine.

Thank you,

Oleg.