From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Bernhard Beschow" <shentey@gmail.com>,
qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH] meson: Add most 3rd-party includes as system includes
Date: Fri, 11 Jul 2025 12:00:24 +0100 [thread overview]
Message-ID: <aHDuyBl4rc4eWvIn@redhat.com> (raw)
In-Reply-To: <CAFEAcA_cfg5je7Nx-qsQoB=cY7KRYan1+wXhWztoLydnjpg15Q@mail.gmail.com>
On Fri, Jul 11, 2025 at 11:45:08AM +0100, Peter Maydell wrote:
> On Tue, 17 Jun 2025 at 21:35, Bernhard Beschow <shentey@gmail.com> wrote:
> >
> > When compiling QEMU against fuse3-3.17.1 with --enable-werror the build fails
> > with:
> >
> > In file included from ../src/block/export/fuse.c:33:
> > /usr/include/fuse3/fuse.h:959:5: error: redundant redeclaration of ‘fuse_main_real_versioned’ [-Werror=redundant-decls]
> > 959 | int fuse_main_real_versioned(int argc, char *argv[],
> > | ^~~~~~~~~~~~~~~~~~~~~~~~
> > /usr/include/fuse3/fuse.h:885:5: note: previous declaration of ‘fuse_main_real_versioned’ with type ‘int(int, char **, const struct fuse_operations *, size_t, struct libfuse_version *, void *)’ {aka ‘int(int, char **, const struct fuse_operations *, long unsigned int, struct libfuse_version *, void *)’}
> > 885 | int fuse_main_real_versioned(int argc, char *argv[],
> > | ^~~~~~~~~~~~~~~~~~~~~~~~
> > cc1: all warnings being treated as errors
> >
> > That is, a fuse header triggers a warning within itself. Since QEMU adds the
> > fuse3 include path via `-I`, the compiler thinks that the header is part of the
> > QEMU project, and thus raises a warning. The compiler can be told to ignore
> > warnings within 3rd party headers by adding these paths via `-isystem`. Fix the
> > above build failure by marking fuse as system dependency. While at it mark
> > every 3rd-party dependency as system dependency to prevent similar issues in the
> > future but skip glib since that results in glib include paths to be omitted from
> > bindgen in case of a Rust build.
>
> The problem with this is that -isystem does not only do "suppress
> warnings in these headers" -- it also alters the search order
> for includes, in a way that can sometimes cause problems:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129
> So this isn't completely risk-free, though I think meson tries to
> avoid some of this by doing something a bit more complex than a
> pure 's/-I/-isystem/'.
>
> We would also lose the warnings about e.g. use of deprecated
> functions in our dependencies.
>
> All that said, this might still be the best tradeoff.
FWIW, the actual bug mentioned here is a clear regression & mistake in
libfuse3 3.17.1 only, that they really should fix. I've filed this:
https://github.com/libfuse/libfuse/issues/1282
and will likely send a PR too later.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2025-07-11 11:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-17 20:34 [PATCH] meson: Add most 3rd-party includes as system includes Bernhard Beschow
2025-07-03 6:25 ` Bernhard Beschow
2025-07-10 17:54 ` Bernhard Beschow
2025-07-11 10:26 ` Philippe Mathieu-Daudé
2025-07-11 10:45 ` Peter Maydell
2025-07-11 11:00 ` Daniel P. Berrangé [this message]
2025-07-15 13:45 ` Daniel P. Berrangé
2025-07-16 8:13 ` Bernhard Beschow
2025-07-16 9:17 ` Daniel P. Berrangé
2025-07-14 10:35 ` Bernhard Beschow
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=aHDuyBl4rc4eWvIn@redhat.com \
--to=berrange@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=shentey@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).