From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, armbru@redhat.com, mst@redhat.com
Subject: [Qemu-devel] [PATCH 0/2] Use glib's checks for use of too-new functions
Date: Fri, 29 May 2015 16:01:46 +0100 [thread overview]
Message-ID: <1432911708-22845-1-git-send-email-dgilbert@redhat.com> (raw)
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
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
next reply other threads:[~2015-05-29 15:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-29 15:01 Dr. David Alan Gilbert (git) [this message]
2015-05-29 15:01 ` [Qemu-devel] [PATCH 1/2] Fix glib_subprocess test Dr. David Alan Gilbert (git)
2015-05-29 15:01 ` [Qemu-devel] [PATCH 2/2] Compile time checks for newer glib Dr. David Alan Gilbert (git)
2015-05-29 15:37 ` Paolo Bonzini
2015-05-29 15:49 ` Dr. David Alan Gilbert
2015-05-29 15:53 ` Peter Maydell
2015-05-29 16:01 ` Dr. David Alan Gilbert
2015-06-01 18:01 ` John Snow
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=1432911708-22845-1-git-send-email-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=armbru@redhat.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).