[Ffmpeg-devel] [PATCH] Add missing __format__ attributes where missing
matthieu castet
castet.matthieu
Sat Mar 17 23:06:57 CET 2007
Michael Niedermayer wrote:
> Hi
"http://host:port/path?option1=val1&option2=val2... */
>> -static void url_add_option(char *buf, int buf_size, const char *fmt, ...)
>> +static
>> +#ifdef __GNUC__
>> + __attribute__ ((__format__ (__printf__, 3, 4) ))
>> +#endif
>> +void url_add_option(char *buf, int buf_size, const char *fmt, ...)
>> {
>
> this mess is unacceptable, either implement it cleanly or leave it
>
> that is
> static av_foobar(...) void url_add_option(char *buf, int buf_size, const char *fmt, ...)
>
> #ifdef __GNUC__
> #define av_foobar() ...
> #else
> #define av_foobar()
> #endif
>
Why don't we do like other attribute stuff (alignement, always inline,
...) :
#ifdef __GNUC__
#define attribute_format(x, y, z) __attribute__ ((__format__ (x, y, z) ))
#else
#define attribute_format(x,y,z)
#endif
And then use attribute_format
Matthieu
More information about the ffmpeg-devel
mailing list