From: Oleg Nesterov <oleg@redhat.com>
To: Chris Li <sparse@chrisli.org>
Cc: Luc Van Oostenryck <lucvoo@kernel.org>,
Alexey Gladkov <legion@kernel.org>,
linux-sparse@vger.kernel.org
Subject: Re: [PATCH] sparse/pre-process: introduce "dissect_mode" option to fix dissect/semind
Date: Sat, 17 Jan 2026 17:32:03 +0100 [thread overview]
Message-ID: <aWu5g1VkGe0ktRaW@redhat.com> (raw)
In-Reply-To: <aWuagcDh53AQxEmw@redhat.com>
On 01/17, Oleg Nesterov wrote:
>
> Agreed! This was my plan B ;)
>
> With this change
>
> - if (!dissect_mode) {
> + if (preprocess_only) {
>
> make check reports 2 failures
>
> -parsing/attr-cleanup.c:10:17: error: argument is not an identifier
> +parsing/attr-cleanup.c:10:27: error: argument is not an identifier
>
> -sizeof-void.c:20:14: warning: expression using sizeof(void)
> +sizeof-void.c:20:27: warning: expression using sizeof(void)
>
> but the new positions look more correct.
>
> However. I didn't dare to send this patch because other warnings from
> sizeof-void.c still blame the column 14, this looks inconsistent...
> But perhaps we don't really care?
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?
Oleg.
> So. I am going to update the changelog and send the trivial V2 below.
>
> Will you agree?
>
> Oleg.
> ---
>
> diff --git a/pre-process.c b/pre-process.c
> index 3fb25082..a4bb6cb6 100644
> --- a/pre-process.c
> +++ b/pre-process.c
> @@ -294,9 +294,11 @@ static struct token *collect_arg(struct token *prev, int vararg, struct position
> } else if (match_op(next, ',') && !nesting && !vararg) {
> break;
> }
> - next->pos.stream = pos->stream;
> - next->pos.line = pos->line;
> - next->pos.pos = pos->pos;
> + if (preprocess_only) {
> + next->pos.stream = pos->stream;
> + next->pos.line = pos->line;
> + next->pos.pos = pos->pos;
> + }
> next->pos.newline = 0;
> p = &next->next;
> }
> diff --git a/validation/parsing/attr-cleanup.c b/validation/parsing/attr-cleanup.c
> index ac64649c..fa3cb1ca 100644
> --- a/validation/parsing/attr-cleanup.c
> +++ b/validation/parsing/attr-cleanup.c
> @@ -24,7 +24,7 @@ int test(int n)
> * check-command: sparse -Wunknown-attribute $file
> *
> * check-error-start
> -parsing/attr-cleanup.c:10:17: error: argument is not an identifier
> +parsing/attr-cleanup.c:10:27: error: argument is not an identifier
> parsing/attr-cleanup.c:11:39: error: an argument is expected for attribute 'cleanup'
> parsing/attr-cleanup.c:12:40: error: an argument is expected for attribute 'cleanup'
> parsing/attr-cleanup.c:13:43: error: Expected ) after attribute's argument'
> diff --git a/validation/sizeof-void.c b/validation/sizeof-void.c
> index 0fd917a2..6792ff02 100644
> --- a/validation/sizeof-void.c
> +++ b/validation/sizeof-void.c
> @@ -36,7 +36,7 @@ sizeof-void.c:16:14: warning: expression using sizeof(void)
> sizeof-void.c:17:14: warning: expression using sizeof(void)
> sizeof-void.c:18:14: warning: expression using sizeof(void)
> sizeof-void.c:19:14: warning: expression using sizeof(void)
> -sizeof-void.c:20:14: warning: expression using sizeof(void)
> +sizeof-void.c:20:27: warning: expression using sizeof(void)
> sizeof-void.c:21:14: warning: expression using sizeof(void)
> sizeof-void.c:22:14: warning: expression using sizeof(void)
> sizeof-void.c:23:14: warning: expression using sizeof(void)
next prev parent reply other threads:[~2026-01-17 16:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-17 15:17 [PATCH] sparse/pre-process: introduce "dissect_mode" option to fix dissect/semind Oleg Nesterov
2026-01-16 23:29 ` Chris Li
2026-01-17 14:19 ` Oleg Nesterov
2026-01-17 16:32 ` Oleg Nesterov [this message]
2026-01-19 0:23 ` Chris Li
2026-01-19 12:32 ` Oleg Nesterov
2026-01-19 0:21 ` Chris Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aWu5g1VkGe0ktRaW@redhat.com \
--to=oleg@redhat.com \
--cc=legion@kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=lucvoo@kernel.org \
--cc=sparse@chrisli.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox