Kaydet (Commit) 326c39f8 authored tarafından Colomban Wendling's avatar Colomban Wendling

Add printf attribute to vprintf() functions

This allows GCC to check vprintf() format, and makes
`-Wsuggest-attribute=format` happy.
üst cbc85b74
...@@ -92,6 +92,7 @@ file_puts (MIO *mio, ...@@ -92,6 +92,7 @@ file_puts (MIO *mio,
return fputs (s, mio->impl.file.fp); return fputs (s, mio->impl.file.fp);
} }
G_GNUC_PRINTF (2, 0)
static gint static gint
file_vprintf (MIO *mio, file_vprintf (MIO *mio,
const gchar *format, const gchar *format,
......
...@@ -241,6 +241,7 @@ mem_puts (MIO *mio, ...@@ -241,6 +241,7 @@ mem_puts (MIO *mio,
return rv; return rv;
} }
G_GNUC_PRINTF (2, 0)
static gint static gint
mem_vprintf (MIO *mio, mem_vprintf (MIO *mio,
const gchar *format, const gchar *format,
......
...@@ -145,7 +145,7 @@ struct _MIO { ...@@ -145,7 +145,7 @@ struct _MIO {
const gchar *s); const gchar *s);
gint (*v_vprintf) (MIO *mio, gint (*v_vprintf) (MIO *mio,
const gchar *format, const gchar *format,
va_list ap); va_list ap) G_GNUC_PRINTF (2, 0);
void (*v_clearerr) (MIO *mio); void (*v_clearerr) (MIO *mio);
gint (*v_eof) (MIO *mio); gint (*v_eof) (MIO *mio);
gint (*v_error) (MIO *mio); gint (*v_error) (MIO *mio);
...@@ -198,7 +198,7 @@ gint mio_puts (MIO *mio, ...@@ -198,7 +198,7 @@ gint mio_puts (MIO *mio,
gint mio_vprintf (MIO *mio, gint mio_vprintf (MIO *mio,
const gchar *format, const gchar *format,
va_list ap); va_list ap) G_GNUC_PRINTF (2, 0);
gint mio_printf (MIO *mio, gint mio_printf (MIO *mio,
const gchar *format, const gchar *format,
...) G_GNUC_PRINTF (2, 3); ...) G_GNUC_PRINTF (2, 3);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment