va_arglist

Robert William Fuller hydrologiccycle@gmail.com
Tue Dec 2 23:27:00 GMT 2008


David Daney wrote:
> Austin, Alex wrote:
>> That's all about unpacking an arglist.
> 
> No, it does both 'packing' and 'unpacking'.
> 
>> I need to pack an arglist. Also, the function in question isn't
>> actually printf, but a custom API, and it doesn't have a vprintf
>> equivalent.
> 
> If your architecture is supported by libffi, and the vargs ABI is the 
> same as the ABI for fixed args, libffi should do exactly what you need.
> 
> David Daney

Whatever you do, don't try to use __builtin_apply.  It's busted on 
x86-64.  This is why the Objective-C runtime is broken out of the box on 
x86-64.  The only reason Objective-C works for the GnuStep project is 
they are using hooks in the runtime to replace calls to __builtin_apply 
with calls to libffi in their runtime.



More information about the Gcc-help mailing list