On 5 January 2015 at 17:44, Daniel Murphy via Digitalmars-d <digitalmars-d@puremagic.com> wrote: > "Iain Buclaw via Digitalmars-d" wrote in message > news:mailman.4157.1420479008.9932.digitalmar...@puremagic.com... > >> For consistency? I would go with (c) as va_list could be anything, >> even a struct (PPC). That and people shouldn't (*!*) be manipulating >> va_list directly, though unfortunately we do for std.format, etc. >> >> The only realistic option would be (a). > > > I think the only code that needs to manipulate va_list directly is low-level > enough that forcing use of a union or *cast(void**)&va is reasonable. > > I think I've got a handle on this, sort of. I've moved the declaration of > __va_argsave into the glue layer, and added intrinsic detection for > va_start/va_end/va_arg (the two-arg form). > > I've implemented them in the backend for win32 and they have passed a simple > test! > > I'll run some more extensive tests tomorrow, and then have a look at some > other platforms. > > Do you think we can change _all_ the druntime and phobos code to just use > va_arg directly? It would be nice to have it all portable like that.
Oh, yeah, do it! You have references to __va_argsave in phobos, don't you?