Skip to content

Use glib's checks for use of too-new functions

Dr. David Alan Gilbert (git) qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Fix glib_subprocess testconfigure+1 -10 replies
2/2Compile time checks for newer glibconfigure include/glib-compat.h tests/test-qdev-global-props.c +1 more+14 -15 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/2] Use glib's checks for use of too-new functions

From: "Dr. David Alan Gilbert" <[email protected]>

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(-)
Signature · 1 line
2.4.1