From 326c39f8d59769237b80463631d57bef58a5a162 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sat, 24 Oct 2015 20:16:44 +0200 Subject: [PATCH] Add printf attribute to vprintf() functions This allows GCC to check vprintf() format, and makes `-Wsuggest-attribute=format` happy. --- tagmanager/mio/mio-file.c | 1 + tagmanager/mio/mio-memory.c | 1 + tagmanager/mio/mio.h | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tagmanager/mio/mio-file.c b/tagmanager/mio/mio-file.c index c19914f34..a5f7a4640 100644 --- a/tagmanager/mio/mio-file.c +++ b/tagmanager/mio/mio-file.c @@ -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, diff --git a/tagmanager/mio/mio-memory.c b/tagmanager/mio/mio-memory.c index 11f9414d4..909ce823f 100644 --- a/tagmanager/mio/mio-memory.c +++ b/tagmanager/mio/mio-memory.c @@ -241,6 +241,7 @@ mem_puts (MIO *mio, return rv; } +G_GNUC_PRINTF (2, 0) static gint mem_vprintf (MIO *mio, const gchar *format, diff --git a/tagmanager/mio/mio.h b/tagmanager/mio/mio.h index d1cb75ded..5fd8d03b4 100644 --- a/tagmanager/mio/mio.h +++ b/tagmanager/mio/mio.h @@ -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); -- 2.11.4.GIT