[Ffmpeg-devel] [PATCH] Add missing __format__ attributes where missing

Michael Niedermayer michaelni
Sun Mar 18 01:34:46 CET 2007


Hi

On Sat, Mar 17, 2007 at 11:06:57PM +0100, matthieu castet wrote:
> 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

this was what i just suggested (though apparently not in a understandable way)
and it needs a av_ prefix!

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070318/f32437bd/attachment.pgp>



More information about the ffmpeg-devel mailing list