From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQcVH-0003nc-QC for qemu-devel@nongnu.org; Wed, 06 Jun 2018 13:45:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQcVD-0001Gf-SB for qemu-devel@nongnu.org; Wed, 06 Jun 2018 13:45:47 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:40430) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fQcVD-0001GO-Jb for qemu-devel@nongnu.org; Wed, 06 Jun 2018 13:45:43 -0400 Received: by mail-qk0-x242.google.com with SMTP id r66-v6so4506021qkr.7 for ; Wed, 06 Jun 2018 10:45:43 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= References: <20180606173233.28080-1-berrange@redhat.com> <20180606173233.28080-4-berrange@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Wed, 6 Jun 2018 14:45:37 -0300 MIME-Version: 1.0 In-Reply-To: <20180606173233.28080-4-berrange@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2 3/3] util: remove redundant include of glib.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "=?UTF-8?Q?Daniel_P._Berrang=c3=a9?=" , qemu-devel@nongnu.org Cc: Peter Maydell , Olaf Hering , Stefan Berger , Michael Roth , Peter Xu , Markus Armbruster , Stefan Hajnoczi , Thomas Huth , Paolo Bonzini On 06/06/2018 02:32 PM, 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) > > Signed-off-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé > --- > util/iova-tree.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/util/iova-tree.c b/util/iova-tree.c > index 2d9cebfc89..d39cd8bb29 100644 > --- a/util/iova-tree.c > +++ b/util/iova-tree.c > @@ -9,7 +9,6 @@ > * This work is licensed under the terms of the GNU GPL, version 2 or later. > */ > > -#include > #include "qemu/iova-tree.h" > > struct IOVATree { >