diff --git a/libavcodec/srtenc.c b/libavcodec/srtenc.c index 9b6f61ebd1..a607beb990 100644 --- a/libavcodec/srtenc.c +++ b/libavcodec/srtenc.c @@ -41,10 +41,7 @@ typedef struct { } SRTContext; -#ifdef __GNUC__ -__attribute__ ((__format__ (__printf__, 2, 3))) -#endif -static void srt_print(SRTContext *s, const char *str, ...) +static av_printf_format(2, 3) void srt_print(SRTContext *s, const char *str, ...) { va_list vargs; va_start(vargs, str); diff --git a/libavcodec/webvttenc.c b/libavcodec/webvttenc.c index 9922f33485..3b66b4f2dd 100644 --- a/libavcodec/webvttenc.c +++ b/libavcodec/webvttenc.c @@ -38,10 +38,7 @@ typedef struct { int stack_ptr; } WebVTTContext; -#ifdef __GNUC__ -__attribute__ ((__format__ (__printf__, 2, 3))) -#endif -static void webvtt_print(WebVTTContext *s, const char *str, ...) +static av_printf_format(2, 3) void webvtt_print(WebVTTContext *s, const char *str, ...) { va_list vargs; va_start(vargs, str);