Commit 3ad56081 authored by Philip Withnall's avatar Philip Withnall

stun: Add missing format attributes for va_list printf functions

As detected by GCC 4.9.
parent 4e4af4be
......@@ -62,6 +62,9 @@ static const GDebugKey keys[] = {
{ NULL, 0},
};
static void
stun_handler (const char *format, va_list ap) G_GNUC_PRINTF (1, 0);
static void
stun_handler (const char *format, va_list ap)
{
......
......@@ -55,6 +55,15 @@ void stun_debug_disable (void) {
debug_enabled = 0;
}
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#define GNUC_PRINTF(format_idx, arg_idx) \
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
#else
#define GNUC_PRINTF( format_idx, arg_idx)
#endif
static void
default_handler (const char *format, va_list ap) GNUC_PRINTF (1, 0);
static void
default_handler (const char *format, va_list ap)
......
......@@ -66,7 +66,12 @@ void stun_debug_disable (void);
*
* Callback for a debug message from the STUN code.
*/
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4))
typedef void (*StunDebugHandler) (const char *format, va_list ap)
__attribute__((__format__ (__printf__, 1, 0)));
#else
typedef void (*StunDebugHandler) (const char *format, va_list ap);
#endif
/**
* stun_set_debug_handler:
......
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