From: "J. Neuschäfer" <j.neuschaefer@gmx.net>
To: Alyssa Ross <hi@alyssa.is>
Cc: "J. Neuschäfer" <j.neuschaefer@gmx.net>, kvm@vger.kernel.org
Subject: Re: [PATCH kvmtool 1/2] Get basename() from <libgen.h> for musl compat
Date: Sat, 27 Jul 2024 18:43:36 +0200 [thread overview]
Message-ID: <ZqUjuObD_cTdgP3V@probook> (raw)
In-Reply-To: <b43mil7j4t5zc2l33vtrixc2puyxm5546fdnsefci7z2sditwa@z7h7jo3jgols>
[-- Attachment #1: Type: text/plain, Size: 1084 bytes --]
On Sat, Jul 27, 2024 at 12:58:37PM +0200, Alyssa Ross wrote:
> On Sat, Jul 27, 2024 at 10:11:14AM GMT, J. Neuschäfer wrote:
> > According to the manpage, basename is defined in <libgen.h>.
> > Not including it results in a compilation failure on musl-libc:
>
> That's not quite what the man page says — there are two versions of
> basename, the POSIX version and the GNU version, with differing
> behaviour.
Right, thanks for catching that!
> > vfio/core.c:538:22: error: implicit declaration of function 'basename' [-Werror=implicit-function-declaration]
> > 538 | group_name = basename(group_path);
> > | ^~~~~~~~
>
> In this case, it should be safe to switch to the POSIX version, because
> group_path is writeable and not used after this, so
>
> Reviewed-by: Alyssa Ross <hi@alyssa.is>
>
> but it would be nicer if the commit message was clearer, because it
> currently reads like it's just including a missing header, rather than
> changing the behaviour of the function.
I'll update and respin.
-- jn
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-07-27 16:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-27 8:11 [PATCH kvmtool 0/2] Fix compilation with musl-libc based toolchains J. Neuschäfer
2024-07-27 8:11 ` [PATCH kvmtool 1/2] Get basename() from <libgen.h> for musl compat J. Neuschäfer
2024-07-27 10:58 ` Alyssa Ross
2024-07-27 16:43 ` J. Neuschäfer [this message]
2024-07-27 8:11 ` [PATCH kvmtool 2/2] Get __WORDSIZE from <sys/reg.h> " J. Neuschäfer
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=ZqUjuObD_cTdgP3V@probook \
--to=j.neuschaefer@gmx.net \
--cc=hi@alyssa.is \
--cc=kvm@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 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.