From 25417a626d0b9077bfbb940952f3858d7b8b549b Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 31 Jan 2012 08:32:06 +0100 Subject: windows: fix format string attributes on MinGW MinGW maps the "printf" format string archetype to the non-standard MSVCRT functions, even if __USE_MINGW_ANSI_STDIO is defined and set to 1. We need to use "gnu_printf" to use the format strings as provided by vsnprintf and similar functions to get correct warnings. Since "gnu_printf" isn't necessarily available on other GCC compatible compilers (such as clang), do this only on MinGW. --- mp_msg.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'mp_msg.h') diff --git a/mp_msg.h b/mp_msg.h index 6e800aecf2..686ed8316c 100644 --- a/mp_msg.h +++ b/mp_msg.h @@ -130,19 +130,15 @@ void mp_msg_init(void); int mp_msg_test(int mod, int lev); #include "config.h" +#include "mpcommon.h" char *mp_gtext(const char *string); void mp_msg_va(int mod, int lev, const char *format, va_list va); -#ifdef __GNUC__ -void mp_msg(int mod, int lev, const char *format, ... ) __attribute__ ((format (printf, 3, 4))); -void mp_tmsg(int mod, int lev, const char *format, ... ) __attribute__ ((format (printf, 3, 4))); -static inline void mp_dbg(int mod, int lev, const char *format, ...) __attribute__ ((format (printf, 3, 4))); -#else // not GNU C -void mp_msg(int mod, int lev, const char *format, ... ); -void mp_tmsg(int mod, int lev, const char *format, ...) -#endif /* __GNUC__ */ +void mp_msg(int mod, int lev, const char *format, ... ) PRINTF_ATTRIBUTE(3, 4); +void mp_tmsg(int mod, int lev, const char *format, ... ) PRINTF_ATTRIBUTE(3, 4); +static inline void mp_dbg(int mod, int lev, const char *format, ...) PRINTF_ATTRIBUTE(3, 4); static inline void mp_dbg(int mod, int lev, const char *format, ...) { -- cgit v1.2.3