From a7926117dde57d6408f292b54d9950b3a1f4cb79 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 26 Jul 2017 11:34:02 +0200 Subject: [PATCH] gdatetime: Silence -Wmaybe-uninitialized MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit GCC 6.3.1 thinks that tmp is being used uninitialized: gdatetime.c: In function ‘format_ampm’: gdatetime.c:2248:7: warning: ‘tmp’ may be used uninitialized in this function [-Wmaybe-uninitialized] g_free (tmp); ^~~~~~~~~~~~ It is not an actual problem because the code in question is guarded by "if (!locale_is_utf8)" and "#if defined (HAVE_LANGINFO_TIME)", and it does get initialized under those circumstances. Still, it is a small price to pay for a cleaner build and having actual problems stand out more prominently. https://bugzilla.gnome.org/show_bug.cgi?id=785438 --- glib/gdatetime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/gdatetime.c b/glib/gdatetime.c index 745a32a9d..bad4ded3f 100644 --- a/glib/gdatetime.c +++ b/glib/gdatetime.c @@ -2220,7 +2220,7 @@ format_ampm (GDateTime *datetime, gboolean uppercase) { const gchar *ampm; - gchar *tmp, *ampm_dup; + gchar *tmp = NULL, *ampm_dup; gsize len; ampm = GET_AMPM (datetime); -- 2.11.4.GIT