From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzU1h-0001Sh-8l for qemu-devel@nongnu.org; Mon, 01 Jun 2015 14:01:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzU1d-0007OS-09 for qemu-devel@nongnu.org; Mon, 01 Jun 2015 14:01:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzU1c-0007OI-S6 for qemu-devel@nongnu.org; Mon, 01 Jun 2015 14:01:24 -0400 Message-ID: <556C9DF3.9080504@redhat.com> Date: Mon, 01 Jun 2015 14:01:23 -0400 From: John Snow MIME-Version: 1.0 References: <1432911708-22845-1-git-send-email-dgilbert@redhat.com> <1432911708-22845-3-git-send-email-dgilbert@redhat.com> <20150529160130.GC20215@work-vm> In-Reply-To: <20150529160130.GC20215@work-vm> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] Compile time checks for newer glib List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" , Peter Maydell Cc: pbonzini@redhat.com, "Michael S. Tsirkin" , QEMU Developers , Markus Armbruster On 05/29/2015 12:01 PM, Dr. David Alan Gilbert wrote: > * Peter Maydell (peter.maydell@linaro.org) wrote: >> On 29 May 2015 at 16:01, Dr. David Alan Gilbert (git) >> wrote: >>> --- a/include/glib-compat.h >>> +++ b/include/glib-compat.h >>> @@ -16,6 +16,12 @@ >>> #ifndef QEMU_GLIB_COMPAT_H >>> #define QEMU_GLIB_COMPAT_H >>> >>> +/* >>> + * The source file including this compat header knows it's using newer glib >>> + * functions than we generally allow, so don't warn about it. >>> + */ >>> +#undef GLIB_VERSION_MIN_REQUIRED >>> +#undef GLIB_VERSION_MAX_ALLOWED >>> #include >> >> ...but glib-compat.h is included by qemu-common.h and in general >> the point is that code anywhere in QEMU can assume the compat >> versions exist, so it feels like this will defeat the point. > > Hmm, a lot of files seem to include glib.h directly. But OK, > so then Paolo is suggesting setting the minimum to 2.32 > which I can do, but then that wouldn't stop something that's > in 2.22-2.32 but not in glib-compat.h > > Dave > >> >> -- PMM > -- > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK > When I bumped glib to 2.22, I played with using these macros and forcing all files to include glib-compat and prohibiting direct includes of glib. The problem is without a minimum version set to 2.3x, as you've stated, the deprecated warnings will trigger for functions we added explicit compat wrappers for, and I could think of no sane way to "forgive" these usages as a one-time exception. Perhaps -- /perhaps/ -- you could have a qemu-internal glib.h that sets the version warnings and leave glib-compat alone without those includes, but this seems like a setup that is inviting frustration for future devs. --js