av_printf_format
là macro, có thể tùy chọn thêm thuộc tính GCC vào khai báo hàm. Nó được xác định in attributes.h:
#ifdef __GNUC__
# define av_builtin_constant_p __builtin_constant_p
# define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
#else
# define av_builtin_constant_p(x) 0
# define av_printf_format(fmtpos, attrpos)
#endif
Vì vậy, đây thực sự là khai báo hàm, có thể có thuộc tính cụ thể nếu được biên soạn trên GCC.
Thuộc tính format
cho GCC biết rằng hàm sẽ lấy đối số của nó như printf
, giúp chẩn đoán một số lỗi.
Cảm ơn bạn đã giải thích! – vericule