From: Anthony PERARD <anthony@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>, Hongbo <hehongbo@mail.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
Juergen Gross <jgross@suse.com>,
xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v2 1/1] tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute
Date: Fri, 25 Apr 2025 11:42:10 +0200 [thread overview]
Message-ID: <aAtY8n5xF6SExmDJ@l14> (raw)
In-Reply-To: <54d1d04a-e2b5-449e-97d9-8888e5b0f5eb@suse.com>
On Tue, Apr 08, 2025 at 12:38:16PM +0200, Jan Beulich wrote:
> On 30.03.2025 18:03, Hongbo wrote:
> > + {
> > + char *path_dup = libxl__strdup(gc, path_env);
> > + char *saveptr;
> > +
> > + char *path = strtok_r(path_dup, ":", &saveptr);
>
> Main reason I'm replying here is this one though, where CI found gcc to
> object:
>
> libxl_dm.c: In function 'libxl__domain_device_model':
> libxl_dm.c:356:31: error: 'saveptr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> char *candidate = libxl__abs_path(gc, configured_dm, path);
> ^
> cc1: all warnings being treated as errors
>
> The compiler can't know that path_dup is guaranteed non-NULL. Hence, if it
> can see (part of) the implementation of strtok_r(), it would observe that
> it's possible that the continuation-invocation path is taken, where
> saveptr necessarily is consumed.
I'll recommit this patch again with `saveptr` initialised to NULL. My
man page says some implementation requires this anyway.
Cheers,
--
Anthony PERARD
next prev parent reply other threads:[~2025-04-25 9:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-23 3:17 [XEN PATCH 1/1] tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute Hongbo
2025-03-12 15:07 ` Anthony PERARD
2025-03-30 16:03 ` [XEN PATCH v2 " Hongbo
2025-04-04 13:51 ` Anthony PERARD
2025-04-08 10:38 ` Jan Beulich
2025-04-25 9:42 ` Anthony PERARD [this message]
2025-04-05 11:10 ` [XEN PATCH v2 RESEND " Hongbo
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=aAtY8n5xF6SExmDJ@l14 \
--to=anthony@xenproject.org \
--cc=anthony.perard@vates.tech \
--cc=hehongbo@mail.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.