Fawzi Mohamed <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #1 from Fawzi Mohamed <> 2010-11-24 15:24:32 PST ---
The clean way to fix this (and what LDC does) is to pack all arguments
(aligning them) in a stack allocated array, create the typeinfo array, and then
call the function passing to it a void* to the packed array and the typeinfo

Thus the D vararg would be equivalent to void*,TypeInfo[].
More explicitly
f(...) -> f(void*,TypeInfo[])

This is slightly less efficient than C for some arguments, but is very
portable, and one can skip an argument just using typeinfo information (tsize,
and possibly alignment).

This was the first bug I did encounter when coming to D: I did try to print a
complex number and it failed because tango did not explicitly decode a complex.
I did add support for some more kinds of hard coded structs to decode, but as
nfxjfg says it is impossible to cover all cases on all architectures, as one
should cover all possible types at compile time and decode each one with a
special va_arg call.

The proposed solution is relatively efficient, and portable.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to