[PATCH] Add missing __format__ attributes where missing
As per summary, this patch adds a few __format__ attribute where missing, thanks to -Wmissing-format-attributes . -- Diego "Flameeyes" Petten? - http://farragut.flameeyes.is-a-geek.org/ Gentoo/Alt lead, Gentoo/FreeBSD, Video, AMD64, Sound, PAM, KDE
Hi On Thu, Jul 06, 2006 at 01:20:10AM +0200, Diego 'Flameeyes' Petten? wrote:
As per summary, this patch adds a few __format__ attribute where missing, thanks to -Wmissing-format-attributes .
-- Diego "Flameeyes" Petten? - http://farragut.flameeyes.is-a-geek.org/ Gentoo/Alt lead, Gentoo/FreeBSD, Video, AMD64, Sound, PAM, KDE
Add format attributes to functions missing it. [...] -static void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) +static +#ifdef __GNUC__ + __attribute__ ((__format__ (__printf__, 3, 0))) +#endif +void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) { static int print_prefix=1; AVClass* avc= ptr ? *(AVClass**)ptr : NULL; @@ -1325,7 +1329,11 @@ #define fprintf please_use_av_log vfprintf(stderr, fmt, vl); }
-static void (*av_log_callback)(void*, int, const char*, va_list) = av_log_default_callback; +static +#ifdef __GNUC__ + __attribute__ ((__format__ (__printf__, 3, 0))) +#endif +void (*av_log_callback)(void*, int, const char*, va_list) = av_log_default_callback;
void av_log(void* avcl, int level, const char *fmt, ...) { diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c index 9edd20f..af111f5 100644 --- a/libavformat/rtpproto.c +++ b/libavformat/rtpproto.c @@ -71,7 +71,11 @@ int rtp_set_remote_url(URLContext *h, co
/* add option to url of the form: "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 [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I know you won't believe me, but the highest form of Human Excellence is to question oneself and others. -- Socrates
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
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
participants (3)
-
castet.matthieu@free.fr -
flameeyes@gentoo.org -
michaelni@gmx.at