From: Daniel Elstner Date: Tue, 6 Oct 2015 20:42:52 +0000 (+0200) Subject: exception: Decorate catch function with format attribute X-Git-Tag: libsigrokdecode-0.4.0~43 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=943f9176255c63924fcf55c6ba8bad05e91d4923;p=libsigrokdecode.git exception: Decorate catch function with format attribute --- 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