From ac426323570113bb13605b20d47273c8c23e3fe3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 13 Aug 2020 17:25:43 +0200 Subject: Add format attributes --- zix/common.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'zix') diff --git a/zix/common.h b/zix/common.h index f0737eb..e427885 100644 --- a/zix/common.h +++ b/zix/common.h @@ -52,6 +52,12 @@ extern "C" { # include #endif +#ifdef __GNUC__ +#define ZIX_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1))) +#else +#define ZIX_LOG_FUNC(fmt, arg1) +#endif + // Unused parameter macro to suppresses warnings and make it impossible to use #if defined(__cplusplus) # define ZIX_UNUSED(name) -- cgit v1.2.1