qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] Use glib's checks for use of too-new functions
@ 2015-05-29 15:01 Dr. David Alan Gilbert (git)
  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)
  0 siblings, 2 replies; 8+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2015-05-29 15:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, armbru, mst

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-06-01 18:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-29 15:01 [Qemu-devel] [PATCH 0/2] Use glib's checks for use of too-new functions Dr. David Alan Gilbert (git)
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

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).