From: Philippe Proulx Date: Sat, 20 May 2017 00:32:45 +0000 (-0400) Subject: logging-internal.h: use __attribute__((format)) to check parameters X-Git-Tag: v2.0.0-pre1~213 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=995dc21f6bf37f76a75e2b77a64207f3d2d24156 logging-internal.h: use __attribute__((format)) to check parameters Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/include/babeltrace/logging-internal.h b/include/babeltrace/logging-internal.h index 1480a082..ffcf1cdc 100644 --- a/include/babeltrace/logging-internal.h +++ b/include/babeltrace/logging-internal.h @@ -434,9 +434,13 @@ #endif #if defined(__printflike) - #define _BT_LOG_PRINTFLIKE(a, b) __printflike(a, b) + #define _BT_LOG_PRINTFLIKE(str_index, first_to_check) \ + __printflike(str_index, first_to_check) +#elif defined(__GNUC__) + #define _BT_LOG_PRINTFLIKE(str_index, first_to_check) \ + __attribute__((format(__printf__, str_index, first_to_check))) #else - #define _BT_LOG_PRINTFLIKE(a, b) + #define _BT_LOG_PRINTFLIKE(str_index, first_to_check) #endif #if (defined(_WIN32) || defined(_WIN64)) && !defined(__GNUC__)