diff options
author | Henrique Dante de Almeida <hdante@gmail.com> | 2013-01-13 14:05:14 -0200 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2013-01-13 12:15:24 -0500 |
commit | 28bd57d6c80d6a0056ef64c5d238c2ad53586997 (patch) | |
tree | 383d36eebbec6c8ed4ed87da76f5cf63728fa6bd /gio | |
parent | de001225c39a4c4f5773b88b9805456f60d11374 (diff) | |
download | glib-wip/format-errors.tar.gz |
Add G_GNUC_PRINTF on all functions with format stringswip/format-errors
This allows compilation with clang wihtout errors, even
when -Wformat-nonliteral is active (as long as there are
no real cases of non literal formatting).
https://bugzilla.gnome.org/show_bug.cgi?id=691608
Diffstat (limited to 'gio')
-rw-r--r-- | gio/gdbusauth.c | 1 | ||||
-rw-r--r-- | gio/gdbusauthmechanismsha1.c | 1 | ||||
-rw-r--r-- | gio/gdbusdaemon.c | 1 | ||||
-rw-r--r-- | gio/gdbuserror.h | 4 | ||||
-rw-r--r-- | gio/gdbusmessage.c | 1 | ||||
-rw-r--r-- | gio/gdbusmethodinvocation.h | 5 | ||||
-rw-r--r-- | gio/gsimpleasyncresult.h | 5 | ||||
-rw-r--r-- | gio/gtask.h | 2 |
8 files changed, 13 insertions, 7 deletions
diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c index 962a218c0..dd4cc2ca5 100644 --- a/gio/gdbusauth.c +++ b/gio/gdbusauth.c @@ -46,6 +46,7 @@ #include "glibintl.h" +G_GNUC_PRINTF(1, 2) static void debug_print (const gchar *message, ...) { diff --git a/gio/gdbusauthmechanismsha1.c b/gio/gdbusauthmechanismsha1.c index 4729208e0..5e8b6c059 100644 --- a/gio/gdbusauthmechanismsha1.c +++ b/gio/gdbusauthmechanismsha1.c @@ -469,6 +469,7 @@ keyring_lookup_entry (const gchar *cookie_context, } /* function for logging important events that the system administrator should take notice of */ +G_GNUC_PRINTF(1, 2) static void _log (const gchar *message, ...) diff --git a/gio/gdbusdaemon.c b/gio/gdbusdaemon.c index 35a724c37..23937710c 100644 --- a/gio/gdbusdaemon.c +++ b/gio/gdbusdaemon.c @@ -1346,6 +1346,7 @@ handle_start_service_by_name (_GFreedesktopDBus *object, return TRUE; } +G_GNUC_PRINTF(5, 6) static void return_error (Client *client, GDBusMessage *message, GQuark domain, diff --git a/gio/gdbuserror.h b/gio/gdbuserror.h index d32b92893..c1d3e9c5e 100644 --- a/gio/gdbuserror.h +++ b/gio/gdbuserror.h @@ -87,12 +87,12 @@ void g_dbus_error_set_dbus_error (GError **error, const gchar *dbus_error_name, const gchar *dbus_error_message, const gchar *format, - ...); + ...) G_GNUC_PRINTF(4, 5); void g_dbus_error_set_dbus_error_valist (GError **error, const gchar *dbus_error_name, const gchar *dbus_error_message, const gchar *format, - va_list var_args); + va_list var_args) G_GNUC_PRINTF(4, 0); gchar *g_dbus_error_encode_gerror (const GError *error); G_END_DECLS diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c index ecbc03385..9181029b4 100644 --- a/gio/gdbusmessage.c +++ b/gio/gdbusmessage.c @@ -827,6 +827,7 @@ g_dbus_message_new_method_error_literal (GDBusMessage *method_call_message, * * Since: 2.26 */ +G_GNUC_PRINTF(3, 0) GDBusMessage * g_dbus_message_new_method_error_valist (GDBusMessage *method_call_message, const gchar *error_name, diff --git a/gio/gdbusmethodinvocation.h b/gio/gdbusmethodinvocation.h index 9146b21a5..29cfe63a1 100644 --- a/gio/gdbusmethodinvocation.h +++ b/gio/gdbusmethodinvocation.h @@ -55,12 +55,13 @@ void g_dbus_method_invocation_return_error (GDBusMetho GQuark domain, gint code, const gchar *format, - ...); + ...) G_GNUC_PRINTF(4, 5); void g_dbus_method_invocation_return_error_valist (GDBusMethodInvocation *invocation, GQuark domain, gint code, const gchar *format, - va_list var_args); + va_list var_args) + G_GNUC_PRINTF(4, 0); void g_dbus_method_invocation_return_error_literal (GDBusMethodInvocation *invocation, GQuark domain, gint code, diff --git a/gio/gsimpleasyncresult.h b/gio/gsimpleasyncresult.h index 623336908..1ea98f405 100644 --- a/gio/gsimpleasyncresult.h +++ b/gio/gsimpleasyncresult.h @@ -110,7 +110,8 @@ void g_simple_async_result_set_error_va (GSimpleAsyncResult GQuark domain, gint code, const char *format, - va_list args); + va_list args) + G_GNUC_PRINTF(4, 0); gboolean g_simple_async_result_is_valid (GAsyncResult *result, GObject *source, gpointer source_tag); @@ -121,7 +122,7 @@ void g_simple_async_report_error_in_idle (GObject *object, GQuark domain, gint code, const char *format, - ...); + ...) G_GNUC_PRINTF(6, 7); void g_simple_async_report_gerror_in_idle (GObject *object, GAsyncReadyCallback callback, gpointer user_data, diff --git a/gio/gtask.h b/gio/gtask.h index bb032267b..d5a2d774f 100644 --- a/gio/gtask.h +++ b/gio/gtask.h @@ -61,7 +61,7 @@ void g_task_report_new_error (gpointer source_object, GQuark domain, gint code, const char *format, - ...); + ...) G_GNUC_PRINTF(7, 8); GLIB_AVAILABLE_IN_2_36 void g_task_set_task_data (GTask *task, |