[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: va_list function portability doco
From: |
Kevin Ryde |
Subject: |
Re: va_list function portability doco |
Date: |
Fri, 15 Feb 2002 06:56:41 +1000 |
User-agent: |
Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.1 (i386-debian-linux-gnu) |
Akim Demaille <address@hidden> writes:
>
> It seems like this guy never went in. Would you install it please?
I'd like to propose a newer version below.
* doc/autoconf.texi (Function Portability): Notes on va_copy, va_list.
@item @code{va_copy}
@c @fuindex va_copy
@prindex @code{va_copy}
The ISO C99 standard provides @code{va_copy} for copying
@code{va_list} variables. It may be available in older environments
too, though possibly as @code{__va_copy} (eg. @command{gcc} in strict
C89 mode). These can be tested with @code{#ifdef}. A fallback to
@code{memcpy (&dst, &src, sizeof(va_list))} will give maximum
portability.
@item @code{va_list}
@c @fuindex va_list
@prindex @code{va_list}
@code{va_list} is not necessarily just a pointer. It can be a
@code{struct} (eg. @command{gcc} on Alpha), which means @code{NULL} is
not portable. Or it can be an array (eg. @command{gcc} in some
PowerPC configurations), which means as a function parameter it can be
effectively call-by-reference and library routines might modify the
value back in the caller (eg. @code{vsnprintf} in the GNU C Library
2.1).