Build problem smatch 1.75

Harshit Mogalapalli <[email protected]> Mon, 4 May 2026 13:25:43 +0530
Newsgroups org.kernel.vger.smatch
Message-ID <[email protected]>
Hi Dan,

Build error:

pre-process.c: In function ‘parse_expansion’:
pre-process.c:1648:16: error: variable-sized object may not be initialized
  1648 |         struct arg_state args[slots] = {};
       |                ^~~~~~~~~
pre-process.c: In function ‘find_include’:
pre-process.c:1015:56: warning: ‘%s’ directive output may be truncated 
writing up to 255 bytes into a region of size between 1 and 4096 
[-Wformat-truncation=]
  1015 |                         snprintf(buf, sizeof(buf), "%s/%s", 
cwd, entry->d_name);
       |                                                        ^~
pre-process.c:1015:25: note: ‘snprintf’ output between 2 and 4352 bytes 
into a destination of size 4097
  1015 |                         snprintf(buf, sizeof(buf), "%s/%s", 
cwd, entry->d_name);
       | 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


I think the problem is introduced by:

Fixes: 1a9a98e3c7b8 ("__VA_OPT__: parsing")

I think we need a memset() in parse_expansion()

thanks,
Harshit