Linux SPARSE checker discussions
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Chris Li <sparse@chrisli.org>, Luc Van Oostenryck <lucvoo@kernel.org>
Cc: Alexey Gladkov <legion@kernel.org>, linux-sparse@vger.kernel.org
Subject: [PATCH] sparse: increase MAX_STRING to 4096*3
Date: Sat, 13 Jun 2026 16:53:47 +0200	[thread overview]
Message-ID: <ai1u-0eA0bCn-VkM@redhat.com> (raw)

Sure, 12288 is just another "random" value, but with this change the
following command

	$ make C=2 CHECK="semind add --"

no longer emits the errors like

	./include/trace/events/vmscan.h:122:17: error: too long token expansion

It is not clear why (before this change) MAX_STRING is odd. I guess this
comes from the initial commit 7601387b02d9 ("C99 says strings should be up
to 4095 bytes."), but I don't think this is relevant at least after another
commit fbc8230fa8c4 ("Larger buffer size for token concatenation") which
increased MAX_STRING to 4096*2-1. And struct string / __alloc_string() do
not depend on the hardcoded constants anyway.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 token.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/token.h b/token.h
index 9000e0cb..720ad0c3 100644
--- a/token.h
+++ b/token.h
@@ -197,7 +197,7 @@ struct token {
 	};
 };
 
-#define MAX_STRING 8191
+#define MAX_STRING (4096*3)
 
 static inline struct token *containing_token(struct token **p)
 {
-- 
2.52.0



                 reply	other threads:[~2026-06-13 14:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=ai1u-0eA0bCn-VkM@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