tests: Fix for non-GCC
[platform/upstream/glib.git] / gio / gcontenttype.c
index da9aa21..8dc5896 100644 (file)
@@ -393,6 +393,8 @@ g_content_type_get_mime_type (const char *type)
   return g_strdup (type);
 }
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
 
 static GIcon *
 g_content_type_get_icon_internal (const gchar *type,
@@ -423,8 +425,6 @@ g_content_type_get_icon_internal (const gchar *type,
   G_LOCK (gio_xdgmime);
   xdg_icon = xdg_mime_get_icon (type);
   G_UNLOCK (gio_xdgmime);
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
    if (xdg_icon != NULL)
     xdg_mimetype_icon = g_strdup_printf (file_template, xdg_icon);
 
@@ -440,7 +440,6 @@ g_content_type_get_icon_internal (const gchar *type,
   xdg_mimetype_generic_icon = g_content_type_get_generic_icon_name (type);
   if (xdg_mimetype_generic_icon)
     generic_mimetype_icon = g_strdup_printf (file_template, xdg_mimetype_generic_icon);
-#pragma GCC diagnostic pop
   if (generic_mimetype_icon)
     icon_names[n++] = generic_mimetype_icon;
 
@@ -453,6 +452,7 @@ g_content_type_get_icon_internal (const gchar *type,
 
   return themed_icon;
 }
+#pragma GCC diagnostic pop
 
 /**
  * g_content_type_get_icon: