[uClibc]__va_copy in new stdio

Manuel Novoa III mjn3 at codepoet.org
Wed Mar 13 05:29:26 UTC 2002


Miles,

On Wed, Mar 13, 2002 at 11:23:47AM +0900, Miles Bader wrote:
> <stdarg.h> on my platform doesn't define `__va_copy', so the function
> `_ppfs_prepargs' in libc/stdio/printf.c gets undefined symbol errors
> when linking.

Wonderful.  I went with __va_copy() hoping that it would be portable
across archs for gcc.  Wishful thinking I guess.

> The glibc manual suggests that a simple copy will often suffice for
> platforms that don't have this macro (and indeed, of the platforms I
> noticed that define it, only the PPC uses something besides a simple
> copy).

Plauger actually recommends using memcpy() in his standard C lib book
(the C89 one), but most of the time that's probably overkill.  Still,
it might be worth doing...

> So how about the following patch:

Applied for now.  Thanks.

I'm wondering if it might be worth creating an <arch>/bits/vacopy.h so
that archs could specify an optimal version of __va_copy() if it was
missing from their stdarg.h.  We could always fall back on memcpy()
as the generic version in common/bits.

Manuel



More information about the uClibc mailing list