From: Peter Xu <peterx@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, Eric Blake <eblake@redhat.com>,
Stefan Berger <stefanb@linux.vnet.ibm.com>,
Markus Armbruster <armbru@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Thomas Huth <thuth@redhat.com>,
Michael Roth <mdroth@linux.vnet.ibm.com>,
Olaf Hering <olaf@aepfle.de>
Subject: Re: [Qemu-devel] [PATCH v3 1/3] util: remove redundant include of glib.h and add osdep.h
Date: Mon, 11 Jun 2018 10:43:57 +0800 [thread overview]
Message-ID: <20180611024357.GI7736@xz-mi> (raw)
In-Reply-To: <20180608131604.16826-2-berrange@redhat.com>
On Fri, Jun 08, 2018 at 02:16:02PM +0100, Daniel P. Berrangé wrote:
> Code must only ever include glib.h indirectly via the glib-compat.h
> header file, because we will need some macros set before glib.h is
> pulled in. Adding extra includes of glib.h will (soon) cause compile
> failures such as:
>
> In file included from /home/berrange/src/virt/qemu/include/qemu/osdep.h:107,
> from /home/berrange/src/virt/qemu/include/qemu/iova-tree.h:26,
> from util/iova-tree.c:13:
> /home/berrange/src/virt/qemu/include/glib-compat.h:22: error: "GLIB_VERSION_MIN_REQUIRED" redefined [-Werror]
> #define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_40
>
> In file included from /usr/include/glib-2.0/glib/gtypes.h:34,
> from /usr/include/glib-2.0/glib/galloca.h:32,
> from /usr/include/glib-2.0/glib.h:30,
> from util/iova-tree.c:12:
> /usr/include/glib-2.0/glib/gversionmacros.h:237: note: this is the location of the previous definition
> # define GLIB_VERSION_MIN_REQUIRED (GLIB_VERSION_CUR_STABLE)
>
> Furthermore, the osdep.h include should always be done directly from the
> .c file rather than indirectly via any .h file.
>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
next prev parent reply other threads:[~2018-06-11 2:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-08 13:16 [Qemu-devel] [PATCH v3 0/3] glib: update the min required version Daniel P. Berrangé
2018-06-08 13:16 ` [Qemu-devel] [PATCH v3 1/3] util: remove redundant include of glib.h and add osdep.h Daniel P. Berrangé
2018-06-08 14:48 ` Eric Blake
2018-06-08 17:26 ` Thomas Huth
2018-06-11 2:43 ` Peter Xu [this message]
2018-06-08 13:16 ` [Qemu-devel] [PATCH v3 2/3] glib: bump min required glib library version to 2.40 Daniel P. Berrangé
2018-06-08 13:16 ` [Qemu-devel] [PATCH v3 3/3] glib: enforce the minimum required version and warn about old APIs Daniel P. Berrangé
2018-06-08 17:33 ` Thomas Huth
2018-06-28 13:09 ` [Qemu-devel] [PATCH v3 0/3] glib: update the min required version Daniel P. Berrangé
2018-06-28 13:15 ` Paolo Bonzini
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=20180611024357.GI7736@xz-mi \
--to=peterx@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=olaf@aepfle.de \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.vnet.ibm.com \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.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).