Skip to contentSkip to conversation

sparse: increase MAX_STRING to 4096*3

PATCH New Oleg Nesterov 1 participant 1 message Jun 13 Sparse checker

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparse: increase MAX_STRING to 4096*3

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.

---
 token.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
token.h +1 -1
index 9000e0cb..720ad0c3 100644
@@ -197,7 +197,7 @@ struct token {
 	};
 };
 
-#define MAX_STRING 8191
+#define MAX_STRING (4096*3)
 
 static inline struct token *containing_token(struct token **p)
 {
Signature · 1 line
2.52.0