This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] ABI change for variable sized types


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]