From 943f9176255c63924fcf55c6ba8bad05e91d4923 Mon Sep 17 00:00:00 2001 From: Daniel Elstner Date: Tue, 6 Oct 2015 22:42:52 +0200 Subject: [PATCH 1/1] exception: Decorate catch function with format attribute --- libsigrokdecode-internal.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libsigrokdecode-internal.h b/libsigrokdecode-internal.h index 6084409..d32414a 100644 --- a/libsigrokdecode-internal.h +++ b/libsigrokdecode-internal.h @@ -104,6 +104,15 @@ SRD_PRIV int py_strseq_to_char(PyObject *py_strseq, char ***out_strv); SRD_PRIV GVariant *py_obj_to_variant(PyObject *py_obj); /* exception.c */ -SRD_PRIV void srd_exception_catch(const char *format, ...); +#if defined(G_OS_WIN32) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) +/* + * On MinGW, we need to specify the gnu_printf format flavor or GCC + * will assume non-standard Microsoft printf syntax. + */ +SRD_PRIV void srd_exception_catch(const char *format, ...) + __attribute__((__format__ (__gnu_printf__, 1, 2))); +#else +SRD_PRIV void srd_exception_catch(const char *format, ...) G_GNUC_PRINTF(1, 2); +#endif #endif -- 2.30.2