summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMarc-André Lureau2022-04-20 15:25:45 +0200
committerMarc-André Lureau2022-04-21 14:56:55 +0200
commit951cc9df88291b275f4db10e6853afd3e2a600c8 (patch)
tree0aef072be0c1c9b28502f82ab52830874a3f051d /util
parentMerge tag 'pull-tcg-20220420' of https://gitlab.com/rth7680/qemu into staging (diff)
downloadqemu-951cc9df88291b275f4db10e6853afd3e2a600c8.tar.gz
qemu-951cc9df88291b275f4db10e6853afd3e2a600c8.tar.xz
qemu-951cc9df88291b275f4db10e6853afd3e2a600c8.zip
glib-compat: isolate g_date_time_format_iso8601 version-bypass
The solution was discussed with Markus Armbruster during the review: https://patchew.org/QEMU/20220323155743.1585078-1-marcandre.lureau@redhat.com/20220323155743.1585078-14-marcandre.lureau@redhat.com/ Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220420132624.2439741-3-marcandre.lureau@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/error-report.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/error-report.c b/util/error-report.c
index d9d3ac30cf..4ec7b30bcb 100644
--- a/util/error-report.c
+++ b/util/error-report.c
@@ -183,9 +183,13 @@ static void print_loc(void)
static char *
real_time_iso8601(void)
{
-#if GLIB_CHECK_VERSION(2, 62, 0)
+#if GLIB_CHECK_VERSION(2,62,0)
g_autoptr(GDateTime) dt = g_date_time_new_from_unix_utc(g_get_real_time());
+ /* ignore deprecation warning, since GLIB_VERSION_MAX_ALLOWED is 2.56 */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
return g_date_time_format_iso8601(dt);
+#pragma GCC diagnostic pop
#else
GTimeVal tv;
g_get_current_time(&tv);