This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/14557] va_list is automatically taken address-of when passed as argument
- From: "falk dot hueffner at student dot uni-tuebingen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Mar 2004 12:16:01 -0000
- Subject: [Bug target/14557] va_list is automatically taken address-of when passed as argument
- References: <20040312161718.14557.olof.lindholm@bea.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From falk dot hueffner at student dot uni-tuebingen dot de 2004-03-13 12:15 -------
Subject: Re: va_list is automatically taken address-of
when passed as argument
"zlomek at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
> ------- Additional Comments From zlomek at gcc dot gnu dot org 2004-03-13 06:10 -------
> AFAIK it is incorrect to use "va_list *" so the code is wrong.
I don't see anything wrong with using "va_list *". The standard even says:
It is permitted to create a pointer to a va_list and pass that
pointer to another function, in which case the original function
may make further use of the original list after the other
function returns.
About passing by value it says:
The object ap may be passed as an argument to another function;
if that function invokes the va_arg macro with parameter ap, the
value of ap in the calling function is indeterminate and shall be
passed to the va_end macro prior to any further reference to ap.
Well, it doesn't invoke va_arg, so that should be fine, too.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14557