They don't allow that pragma inside functions.
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,
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);
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;
return themed_icon;
}
+#pragma GCC diagnostic pop
/**
* g_content_type_get_icon:
g_return_val_if_reached (-1);
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+
static GList *
g_resolver_records_from_res_query (const gchar *rrname,
gint rrtype,
format = _("Error resolving '%s'");
}
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
g_set_error (error, G_RESOLVER_ERROR, errnum, format, rrname);
-#pragma GCC diagnostic pop
return NULL;
}
return records;
}
+#pragma GCC diagnostic pop
+
#elif defined(G_OS_WIN32)
static GVariant *
format_error_message (const gchar *filename,
const gchar *format_string) G_GNUC_FORMAT(2);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+
static char *
format_error_message (const gchar *filename,
const gchar *format_string)
gchar *display_name;
gchar *msg;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
-
display_name = g_filename_display_name (filename);
msg = g_strdup_printf (format_string, display_name, g_strerror (saved_errno));
g_free (display_name);
-#pragma GCC diagnostic pop
-
return msg;
}
+#pragma GCC diagnostic pop
+
/* format string must have two '%s':
*
* - the place for the filename
*
* Since: 2.4
*/
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+
gchar *
g_markup_vprintf_escaped (const gchar *format,
va_list args)
/* Use them to format the arguments
*/
G_VA_COPY (args2, args);
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
output1 = g_strdup_vprintf (format1->str, args);
va_end (args2);
if (!output2)
goto cleanup;
-#pragma GCC diagnostic pop
result = g_string_new (NULL);
/* Iterate through the original format string again,
return NULL;
}
+#pragma GCC diagnostic pop
+
/**
* g_markup_printf_escaped:
* @format: printf() style format string
return g_ascii_formatd (buffer, buf_len, "%.17g", d);
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+
/**
* g_ascii_formatd:
* @buffer: A buffer to place the resulting string in
locale_t old_locale;
old_locale = uselocale (get_C_locale ());
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
_g_snprintf (buffer, buf_len, format, d);
-#pragma GCC diagnostic pop
uselocale (old_locale);
return buffer;
return buffer;
#endif
}
+#pragma GCC diagnostic pop
#define ISSPACE(c) ((c) == ' ' || (c) == '\f' || (c) == '\n' || \
(c) == '\r' || (c) == '\t' || (c) == '\v')
* Flags to modify the format of the string returned by g_format_size_full().
*/
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+
/**
* g_format_size_full:
* @size: a size in bytes
#endif
g_string_append (string, " (");
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
g_string_append_printf (string, translated_format, formatted_number);
-#pragma GCC diagnostic pop
g_free (formatted_number);
g_string_append (string, ")");
}
return g_string_free (string, FALSE);
}
+#pragma GCC diagnostic pop
+
/**
* g_format_size_for_display:
* @size: a size in bytes