Add G_GNUC_PRINTF on all functions with format strings

This allows compilation with clang without 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
This commit is contained in:
Henrique Dante de Almeida
2013-01-13 14:05:14 -02:00
committed by Colin Walters
parent 120834db5b
commit c219181cb2
21 changed files with 39 additions and 19 deletions

View File

@@ -46,6 +46,7 @@
#include "glibintl.h"
G_GNUC_PRINTF(1, 2)
static void
debug_print (const gchar *message, ...)
{

View File

@@ -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,
...)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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