Smatch (Semantic Matching Tool) development
 help / color / mirror / Atom feed
From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
To: smatch@vger.kernel.org
Subject: Build problem smatch 1.75
Date: Mon, 4 May 2026 13:25:43 +0530	[thread overview]
Message-ID: <e8f14631-b01b-4285-8598-acad42c901be@oracle.com> (raw)

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

             reply	other threads:[~2026-05-04  7:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04  7:55 Harshit Mogalapalli [this message]
2026-05-04  8:20 ` Build problem smatch 1.75 Dan Carpenter
2026-05-04 10:47   ` Harshit Mogalapalli
2026-05-05 10:41     ` Dan Carpenter
2026-05-05 14:58       ` Harshit Mogalapalli

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=e8f14631-b01b-4285-8598-acad42c901be@oracle.com \
    --to=harshit.m.mogalapalli@oracle.com \
    --cc=smatch@vger.kernel.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