Add printf attribute to vprintf() functions

This allows GCC to check vprintf() format, and makes
`-Wsuggest-attribute=format` happy.
This commit is contained in:
Colomban Wendling 2015-10-24 20:16:44 +02:00
parent cbc85b7444
commit 326c39f8d5
3 changed files with 4 additions and 2 deletions

View File

@ -92,6 +92,7 @@ file_puts (MIO *mio,
return fputs (s, mio->impl.file.fp);
}
G_GNUC_PRINTF (2, 0)
static gint
file_vprintf (MIO *mio,
const gchar *format,

View File

@ -241,6 +241,7 @@ mem_puts (MIO *mio,
return rv;
}
G_GNUC_PRINTF (2, 0)
static gint
mem_vprintf (MIO *mio,
const gchar *format,

View File

@ -145,7 +145,7 @@ struct _MIO {
const gchar *s);
gint (*v_vprintf) (MIO *mio,
const gchar *format,
va_list ap);
va_list ap) G_GNUC_PRINTF (2, 0);
void (*v_clearerr) (MIO *mio);
gint (*v_eof) (MIO *mio);
gint (*v_error) (MIO *mio);
@ -198,7 +198,7 @@ gint mio_puts (MIO *mio,
gint mio_vprintf (MIO *mio,
const gchar *format,
va_list ap);
va_list ap) G_GNUC_PRINTF (2, 0);
gint mio_printf (MIO *mio,
const gchar *format,
...) G_GNUC_PRINTF (2, 3);