From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyLnI-0001vr-Gl for qemu-devel@nongnu.org; Fri, 29 May 2015 11:01:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyLnD-0003Fz-DC for qemu-devel@nongnu.org; Fri, 29 May 2015 11:01:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53374) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyLnD-0003Fq-8F for qemu-devel@nongnu.org; Fri, 29 May 2015 11:01:51 -0400 From: "Dr. David Alan Gilbert (git)" Date: Fri, 29 May 2015 16:01:46 +0100 Message-Id: <1432911708-22845-1-git-send-email-dgilbert@redhat.com> Subject: [Qemu-devel] [PATCH 0/2] Use glib's checks for use of too-new functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, armbru@redhat.com, mst@redhat.com From: "Dr. David Alan Gilbert" Glib 2.32 adds a checking mechanism to warn of use of functions that are available in glib versions newer than a particular version. This series enables that check (via a -D added during configure); with it you get warnings like: /home/dgilbert/git/qemu-world3/vl.c: In function 'main': /home/dgilbert/git/qemu-world3/vl.c:4385:5: warning: 'g_source_get_ready_time' is deprecated: Not available before 2.36 [-Wdeprecated-declarations] printf("Foo! %lld\n", (long long) g_source_get_ready_time(NULL)); Notes: a) The other patch in the set fixes a configure error that caused a test never to be run even if there was a new enough glib b) Peter said he would prefer something #included rather than added as a -D but then we'd have to change a whole bunch of files to make sure they do that before glib.h is included, and it wouldn't protect you from new code that forgot to do that. c) Glib's older than 2.32 don't have the mechanism and thus don't complain d) The earliest version marker that glib lets you check against is 2.26, which is what I've set it to. Since we allow 2.22 but 2.22 doesn't have this new check, it doesn't cause any warnings. e) Build and make check'd on fedora 22 (glib 2.44), rhel6 (glib 2.26), and rhel5 with glib 2.22 built on it. Dave Dr. David Alan Gilbert (2): Fix glib_subprocess test Compile time checks for newer glib configure | 7 ++++++- include/glib-compat.h | 6 ++++++ tests/test-qdev-global-props.c | 2 +- tests/vhost-user-test.c | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) -- 2.4.1