[Issue 670] _argptr is char *

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 16 06:47:14 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=670



--- Comment #7 from Iain Buclaw <ibuclaw at ubuntu.com> 2011-01-16 06:45:15 PST ---
(In reply to comment #6)
> va_list is a void* on 64 bit targets, too. I originally had it as a pointer to
> that wacky struct required for the 64 bit C ABI, but it works better to treat
> it as a void*, and in the implementation of va_arg do the casting as necessary.
> This helps preserve encapsulation.

I'm currently at the point where I'm prototyping passing varargs in a packed
structure (generated on the fly by the caller) on the stack. And using C
varargs to get the address to assign to _argptr.


Think:

foo (parm, ...)
{
    va_start(__cargptr, parm);
    _argptr = va_arg(__cargptr, void*);
}

foo(&__argstruct);


So far it seems to be working well on 32bit architectures for simple
datatypes...


Needs more testing though before I'd consider it fit for pushing out there.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the D.gnu mailing list