[asterisk-dev] russell: trunk r118556 - /trunk/include/asterisk/compat.h

Tony Mountifield tony at softins.clara.co.uk
Tue May 27 16:22:40 CDT 2008

In article <20080527192749.73C4DAA4353 at lists.digium.internal>,
SVN commits to the Digium repositories <svn-commits at lists.digium.com> wrote:
> Author: russell
> Date: Tue May 27 14:27:48 2008
> New Revision: 118556
> URL: http://svn.digium.com/view/asterisk?view=rev&rev=118556
> Log:
> Add printf format attribute for vasprintf().
> (closes issue #12729)
> [...]
>  #if !defined(HAVE_VASPRINTF) && !defined(__AST_DEBUG_MALLOC)
> -int vasprintf(char **strp, const char *fmt, va_list ap);
> +int __attribute__ ((format (printf, 2, 0))) vasprintf(char **strp, const char *fmt, va_list ap);

It's also permissible to have the __attribute__ after the function
declaration instead, which IMHO is slightly clearer to read because
the function name is not then buried in the middle of the line:

int vasprintf(char **strp, const char *fmt, va_list ap) __attribute__ ((format (printf, 2, 0)));

Only a minor point, but I thought it worth mentioning.


Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org

More information about the asterisk-dev mailing list