Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Thomas Perale <thomas.perale@mind.be>
To: kvm@vger.kernel.org
Cc: thomas.perale@mind.be
Subject: [PATCH kvmtool] vfio: include libgen.h (for musl compatibility)
Date: Sun, 29 Jun 2025 22:22:21 +0200	[thread overview]
Message-ID: <20250629202221.893360-1-thomas.perale@mind.be> (raw)

Starting GCC14 'implicit-function-declaration' are treated as errors by
default. When building kvmtool with musl libc, the following error
occurs due to missing declaration of 'basename':

vfio/core.c:537:22: error: implicit declaration of function ‘basename’ [-Wimplicit-function-declaration]
  537 |         group_name = basename(group_path);
      |                      ^~~~~~~~
vfio/core.c:537:22: warning: nested extern declaration of ‘basename’ [-Wnested-externs]
vfio/core.c:537:20: error: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  537 |         group_name = basename(group_path);
      |                    ^

This patch fixes the issue by including the appropriate header, ensuring
compatibility with musl and GCC14.

Signed-off-by: Thomas Perale <thomas.perale@mind.be>
Signed-off-by: Thomas Perale <perale.thomas@gmail.com>
---
 vfio/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/vfio/core.c b/vfio/core.c
index 3ff2c0b..8f88489 100644
--- a/vfio/core.c
+++ b/vfio/core.c
@@ -3,6 +3,7 @@
 #include "kvm/ioport.h"
 
 #include <linux/list.h>
+#include <libgen.h>
 
 #define VFIO_DEV_DIR		"/dev/vfio"
 #define VFIO_DEV_NODE		VFIO_DEV_DIR "/vfio"
-- 
2.50.0


             reply	other threads:[~2025-06-29 20:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-29 20:22 Thomas Perale [this message]
2025-06-30  9:02 ` [PATCH kvmtool] vfio: include libgen.h (for musl compatibility) Alexandru Elisei
2025-06-30  9:04   ` Alexandru Elisei
2025-07-21 14:35 ` Will Deacon

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=20250629202221.893360-1-thomas.perale@mind.be \
    --to=thomas.perale@mind.be \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox