This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Constructing function calls with gcc - Manual bug?
On May 31, 2001, Andre Kloss <kloss@rbg.informatik.tu-darmstadt.de> wrote:
> But I don't quite understand the semantics of this internall calls.
> 1. How do I add/change the arguments?
> 2. How do I get the return value?
You don't. These mechanisms are meant for function wrappers, mostly.
You can certainly reverse-engineer the way GCC encodes the function
arguments and return value on certain platforms and use that, but you
may be interested in looking into libffi instead. It lets you
dynamically build function calls, and it is part of the GCC CVS tree.
> 3. __builtin_return(result) seems to leave the program. For what
> reason was it meant?
According to the manual, it's meant to return the result of a
__builtin_apply().
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me