diff --git a/src/printf/printf.h b/src/printf/printf.h index 39d9e89..b85f24d 100644 --- a/src/printf/printf.h +++ b/src/printf/printf.h @@ -49,8 +49,13 @@ extern "C" { #endif #ifdef __GNUC__ +# if ((__GNUC__ == 4 && __GNUC_MINOR__>= 4) || __GNUC__ > 4) +# define ATTR_PRINTF(one_based_format_index, first_arg) \ +__attribute__((format(gnu_printf, (one_based_format_index), (first_arg)))) +# else # define ATTR_PRINTF(one_based_format_index, first_arg) \ -__attribute__((format(__printf__, (one_based_format_index), (first_arg)))) +__attribute__((format(printf, (one_based_format_index), (first_arg)))) +# endif # define ATTR_VPRINTF(one_based_format_index) ATTR_PRINTF((one_based_format_index), 0) #else # define ATTR_PRINTF(one_based_format_index, first_arg)