mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 15:48:54 +02:00
Fix the -Werror=format-nonliteral fixes for older GCCs
They don't allow that pragma inside functions.
This commit is contained in:
@@ -2148,6 +2148,9 @@ g_format_size (guint64 size)
|
||||
* 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
|
||||
@@ -2273,10 +2276,7 @@ g_format_size_full (guint64 size,
|
||||
#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, ")");
|
||||
}
|
||||
@@ -2284,6 +2284,8 @@ g_format_size_full (guint64 size,
|
||||
return g_string_free (string, FALSE);
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
/**
|
||||
* g_format_size_for_display:
|
||||
* @size: a size in bytes
|
||||
|
Reference in New Issue
Block a user