qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: Khem Raj <raj.khem@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH v2] vfio: Include libgen.h for basename API
Date: Fri, 15 Dec 2023 16:38:43 +0100	[thread overview]
Message-ID: <a699fa76-a60e-4141-880a-87ca16bcecf9@redhat.com> (raw)
In-Reply-To: <20231212010228.2701544-1-raj.khem@gmail.com>

Hello,

On 12/12/23 02:02, Khem Raj wrote:
> Glibc has two implementation one based on POSIX which is used when
> libgen.h is included and second implementation is GNU implementation
> which is used when string.h is included. The functions are no identical
> in behavior. Musl C library does not implement the GNU version, but it
> has provided a declaration in string.h but this has been corrected in
> latest musl [1] which exposes places where it was being used from
> string.h to error out especially when -Wimplicit-function-declaration is
> treated as error.
> 
> | ../qemu-8.1.2/hw/vfio/pci.c:3030:18: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> |  3030 |     group_name = basename(group_path);
> 
> clang-17 treats this warning as error by default
> 
> [1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> v2: Add missing link for [1]

Thanks for the fix. The upstream code has changed though and I think we
should be using g_path_get_basename() instead.

Could you please rebase ? Or I will do it in the QEMU 9.0 cycle. This is
too late for QEMU 8.2 anyhow.

Thanks,

C.




> 
>   hw/vfio/pci.c      | 1 +
>   hw/vfio/platform.c | 1 +
>   2 files changed, 2 insertions(+)
> 
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index c62c02f7b6..f043c93b9e 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -19,6 +19,7 @@
>    */
>   
>   #include "qemu/osdep.h"
> +#include <libgen.h>
>   #include <linux/vfio.h>
>   #include <sys/ioctl.h>
>   
> diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
> index 8e3d4ac458..a835ab03be 100644
> --- a/hw/vfio/platform.c
> +++ b/hw/vfio/platform.c
> @@ -16,6 +16,7 @@
>   
>   #include "qemu/osdep.h"
>   #include "qapi/error.h"
> +#include <libgen.h>
>   #include <sys/ioctl.h>
>   #include <linux/vfio.h>
>   



      reply	other threads:[~2023-12-15 15:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12  1:02 [PATCH v2] vfio: Include libgen.h for basename API Khem Raj
2023-12-15 15:38 ` Cédric Le Goater [this message]

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=a699fa76-a60e-4141-880a-87ca16bcecf9@redhat.com \
    --to=clg@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=raj.khem@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).