This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [3.3/mainline;libiberty] Fix vasprintf.c
On Fri, Oct 03, 2003 at 03:54:47PM +0200, Josef Zlomek wrote:
> This file (vasprintf.c) is not usually used because glibc provides vasprintf().
> Anyway, leaving the function as
>
> static int int_vasprintf PARAMS ((char **, const char *, va_list *));
> int
> vasprintf (result, format, args)
> char **result;
> const char *format;
> #if defined (_BSD_VA_LIST_) && defined (__FreeBSD__)
> _BSD_VA_LIST_ args;
> #else
> va_list args;
> #endif
> {
> return int_vasprintf (result, format, &args);
> }
>
> causes this warning:
> vas.c:158: warning: passing arg 3 of `int_vasprintf' from incompatible pointer type
>
> so using "&args" is apparently wrong on x86-64 and ppc64.
Don't understand how that would be possible...
unless you are on __FreeBSD__ and try to pass
a pointer to a _BSD_VA_LIST_ to int_vasprintf's
va_list*.
--
Carlo Wood <carlo@alinoe.com>