Fix the -Werror=format-nonliteral fixes for older GCCs

They don't allow that pragma inside functions.
This commit is contained in:
John Ralls
2013-09-29 11:33:30 -07:00
parent 09d83640a8
commit ab5aa2aa3a
6 changed files with 27 additions and 20 deletions

View File

@@ -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