This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
new gcc __attribute__ for linear varargs
- From: David Gerber <zapek-gcc at meanmachine dot ch>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 13 May 2002 10:16:24 +0200
- Subject: new gcc __attribute__ for linear varargs
Hi,
I'm currently using a modified version of gcc 2.95.3 which has
support for linear varargs. The OS I'm using (MorphOS,
http://www.morphos.de for more info) runs on PPC processors and
uses the svr4 ABI. Since it has the ability to run both PPC
native executables and Amiga m68k executables in a mixed environment,
we added an attribute to gcc to be able to use the common 68k API
for varargs (so that old stuff doesn't break).
For example:
void foobar(int bla, ...);
would be declared as:
void foobar(int bla, ...) __attribute__((varargs68k));
Then, to get the linear array from a PPC native app, we simply do:
va_list va;
va_start(va, bla);
and it's in va->overflow_arg_area
Just like if we would use &bla + 1 on a 68k system. There's more
info on how the whole thing works at http://zapek.meanmachine.ch/morphos/
Now, since we would like to eventually contribute our changes to
gcc 3.x I was wondering if it would be possible to agree on a name
for that attribute as "varargs68k" might be a bit obscure. Would
something like "vararg_linear" be better ?
--
David Gerber