diff options
Diffstat (limited to 'glib')
-rw-r--r-- | glib/gerror.c | 1 | ||||
-rw-r--r-- | glib/gerror.h | 2 | ||||
-rw-r--r-- | glib/gmarkup.c | 2 | ||||
-rw-r--r-- | glib/gmarkup.h | 2 | ||||
-rw-r--r-- | glib/gmessages.h | 4 | ||||
-rw-r--r-- | glib/gprintf.h | 8 | ||||
-rw-r--r-- | glib/gstrfuncs.h | 3 | ||||
-rw-r--r-- | glib/gstring.h | 6 | ||||
-rw-r--r-- | glib/gutils.h | 3 | ||||
-rw-r--r-- | glib/gvariant-parser.c | 4 | ||||
-rw-r--r-- | glib/tests/markup-escape.c | 1 | ||||
-rw-r--r-- | glib/tests/string.c | 1 | ||||
-rw-r--r-- | glib/tests/test-printf.c | 1 |
13 files changed, 26 insertions, 12 deletions
diff --git a/glib/gerror.c b/glib/gerror.c index e6ce3c072..2adbdf84d 100644 --- a/glib/gerror.c +++ b/glib/gerror.c @@ -645,6 +645,7 @@ g_clear_error (GError **err) } } +G_GNUC_PRINTF(2, 0) static void g_error_add_prefix (gchar **string, const gchar *format, diff --git a/glib/gerror.h b/glib/gerror.h index f9020d62c..8b5de288b 100644 --- a/glib/gerror.h +++ b/glib/gerror.h @@ -60,7 +60,7 @@ GError* g_error_new_literal (GQuark domain, GError* g_error_new_valist (GQuark domain, gint code, const gchar *format, - va_list args); + va_list args) G_GNUC_PRINTF(3, 0); void g_error_free (GError *error); GError* g_error_copy (const GError *error); diff --git a/glib/gmarkup.c b/glib/gmarkup.c index 11f68de6f..bf7c00856 100644 --- a/glib/gmarkup.c +++ b/glib/gmarkup.c @@ -403,6 +403,7 @@ set_error_literal (GMarkupParseContext *context, g_propagate_error (error, tmp_error); } +G_GNUC_PRINTF(4, 5) static void set_error (GMarkupParseContext *context, GError **error, @@ -564,6 +565,7 @@ utf8_str (const gchar *utf8, return buf; } +G_GNUC_PRINTF(5, 6) static void set_unescape_error (GMarkupParseContext *context, GError **error, diff --git a/glib/gmarkup.h b/glib/gmarkup.h index d26c2adcc..d0eda4f97 100644 --- a/glib/gmarkup.h +++ b/glib/gmarkup.h @@ -214,7 +214,7 @@ gchar* g_markup_escape_text (const gchar *text, gchar *g_markup_printf_escaped (const char *format, ...) G_GNUC_PRINTF (1, 2); gchar *g_markup_vprintf_escaped (const char *format, - va_list args); + va_list args) G_GNUC_PRINTF(1, 0); typedef enum { diff --git a/glib/gmessages.h b/glib/gmessages.h index 777cda238..d0c19307a 100644 --- a/glib/gmessages.h +++ b/glib/gmessages.h @@ -46,7 +46,7 @@ G_BEGIN_DECLS /* calculate a string size, guaranteed to fit format + args. */ gsize g_printf_string_upper_bound (const gchar* format, - va_list args); + va_list args) G_GNUC_PRINTF(1, 0); /* Log level shift offset for user defined * log levels (0-7 are used by GLib). @@ -101,7 +101,7 @@ void g_log (const gchar *log_domain, void g_logv (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, - va_list args); + va_list args) G_GNUC_PRINTF(3, 0); GLogLevelFlags g_log_set_fatal_mask (const gchar *log_domain, GLogLevelFlags fatal_mask); GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask); diff --git a/glib/gprintf.h b/glib/gprintf.h index d96870fb4..2ed5ecc96 100644 --- a/glib/gprintf.h +++ b/glib/gprintf.h @@ -36,16 +36,16 @@ gint g_sprintf (gchar *string, ...) G_GNUC_PRINTF (2, 3); gint g_vprintf (gchar const *format, - va_list args); + va_list args) G_GNUC_PRINTF(1, 0); gint g_vfprintf (FILE *file, gchar const *format, - va_list args); + va_list args) G_GNUC_PRINTF(2, 0); gint g_vsprintf (gchar *string, gchar const *format, - va_list args); + va_list args) G_GNUC_PRINTF(2, 0); gint g_vasprintf (gchar **string, gchar const *format, - va_list args); + va_list args) G_GNUC_PRINTF(2, 0); G_END_DECLS diff --git a/glib/gstrfuncs.h b/glib/gstrfuncs.h index 3142485a2..e0752d308 100644 --- a/glib/gstrfuncs.h +++ b/glib/gstrfuncs.h @@ -188,7 +188,8 @@ gchar* g_strdup (const gchar *str) G_GNUC_MALLOC; gchar* g_strdup_printf (const gchar *format, ...) G_GNUC_PRINTF (1, 2) G_GNUC_MALLOC; gchar* g_strdup_vprintf (const gchar *format, - va_list args) G_GNUC_MALLOC; + va_list args) G_GNUC_PRINTF(1, 0) + G_GNUC_MALLOC; gchar* g_strndup (const gchar *str, gsize n) G_GNUC_MALLOC; gchar* g_strnfill (gsize length, diff --git a/glib/gstring.h b/glib/gstring.h index a97aa4e8a..c6a11aec1 100644 --- a/glib/gstring.h +++ b/glib/gstring.h @@ -109,13 +109,15 @@ GString* g_string_ascii_down (GString *string); GString* g_string_ascii_up (GString *string); void g_string_vprintf (GString *string, const gchar *format, - va_list args); + va_list args) + G_GNUC_PRINTF(2, 0); void g_string_printf (GString *string, const gchar *format, ...) G_GNUC_PRINTF (2, 3); void g_string_append_vprintf (GString *string, const gchar *format, - va_list args); + va_list args) + G_GNUC_PRINTF(2, 0); void g_string_append_printf (GString *string, const gchar *format, ...) G_GNUC_PRINTF (2, 3); diff --git a/glib/gutils.h b/glib/gutils.h index 8102f5394..6c21bf707 100644 --- a/glib/gutils.h +++ b/glib/gutils.h @@ -187,7 +187,8 @@ gint g_snprintf (gchar *string, gint g_vsnprintf (gchar *string, gulong n, gchar const *format, - va_list args); + va_list args) + G_GNUC_PRINTF(3, 0); void g_nullify_pointer (gpointer *nullify_location); diff --git a/glib/gvariant-parser.c b/glib/gvariant-parser.c index e2e85abb0..d5c036a61 100644 --- a/glib/gvariant-parser.c +++ b/glib/gvariant-parser.c @@ -78,6 +78,7 @@ typedef struct gint start, end; } SourceRef; +G_GNUC_PRINTF(5, 0) static void parser_set_error_va (GError **error, SourceRef *location, @@ -105,6 +106,7 @@ parser_set_error_va (GError **error, g_string_free (msg, TRUE); } +G_GNUC_PRINTF(5, 6) static void parser_set_error (GError **error, SourceRef *location, @@ -130,6 +132,7 @@ typedef struct } TokenStream; +G_GNUC_PRINTF(5, 6) static void token_stream_set_error (TokenStream *stream, GError **error, @@ -525,6 +528,7 @@ ast_free (AST *ast) ast->class->free (ast); } +G_GNUC_PRINTF(5, 6) static void ast_set_error (AST *ast, GError **error, diff --git a/glib/tests/markup-escape.c b/glib/tests/markup-escape.c index 0cd90ef23..b2de289c2 100644 --- a/glib/tests/markup-escape.c +++ b/glib/tests/markup-escape.c @@ -96,6 +96,7 @@ unichar_test (gconstpointer d) escape_test (&t); } +G_GNUC_PRINTF(1, 3) static void test_format (const gchar *format, const gchar *expected, diff --git a/glib/tests/string.c b/glib/tests/string.c index 454574b35..ba55d3df9 100644 --- a/glib/tests/string.c +++ b/glib/tests/string.c @@ -106,6 +106,7 @@ test_string_new (void) g_string_free (string2, TRUE); } +G_GNUC_PRINTF(2, 3) static void my_string_printf (GString *string, const gchar *format, diff --git a/glib/tests/test-printf.c b/glib/tests/test-printf.c index 10d0a1d4a..dbfc8fcbc 100644 --- a/glib/tests/test-printf.c +++ b/glib/tests/test-printf.c @@ -942,6 +942,7 @@ _Pragma ("GCC diagnostic pop") #endif } +G_GNUC_PRINTF(1, 2) static gsize upper_bound (const gchar *format, ...) { |