This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] ABI change for variable sized types
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Wed, 14 Jul 2004 23:26:59 +0200
- Subject: Re: [RFC] ABI change for variable sized types
- References: <20040714215639.GA29786@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Jul 14, 2004 at 02:56:39PM -0700, Richard Henderson wrote:
> The cases of variable sized structures as GCC extensions in C are,
> as far as I can tell, only valid in the context of nested functions.
> Which means that the functions are private to the translation unit,
> and thus there is no ABI change.
How about this?
bar.c:
#include <stdarg.h>
void bar (int n, ...)
{
struct S { int a[n]; } s;
va_list ap;
va_start (ap, n);
s = va_arg (ap, struct S);
va_end (ap);
}
foo.c:
extern void bar (int n, ...);
void foo (int n)
{
struct S { int a[n]; } s;
bar (n, s);
}
This doesn't mean I have something against the ABI change.
> It would not affect
>
> arc arm cris fr30 frv
> x86-64 ia64 iq2000 m32r mcore
> mips mmix mn10300 pa rs6000
> s390 sh sparc v850
>
> as these targets already pass all variable sized types by reference.
Well, x86-64 already changed the ABI between GCC 3.2 and 3.3 in this regard.
Jakub