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: "jsm at polyomino dot org dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Mar 2004 20:04:58 -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 jsm at polyomino dot org dot uk 2004-03-13 20:04 -------
Subject: Re: va_list is automatically taken address-of
when passed as argument
On Sat, 13 Mar 2004, zack at codesourcery dot com wrote:
> &ap should always work; taking the address of an array produces a
> pointer to the array, which has a different type but the same value as
> the pointer to the first element that you get if you don't take the
> address. You have to write *ap in the callee, is all.
The trouble is that in this example you're taking the address of a pointer
to the first element of the array (namely, the parameter declared with the
array type va_list which has pointer type because of the adjustment of
parameter types).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14557