Iain Buclaw <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #26 from Iain Buclaw <> 2012-06-26 07:16:09 PDT 
(In reply to comment #25)
> Sigh – seems like I was not exactly right about how GDC and LDC are handling
> arrays. Instead of treating them like the equivalent struct, they are treated
> as if length and pointer were two separate arguments, with the important
> difference of course being that with the x86_64 ABI, structs are never only
> partly passed in registers (i.e., if there is only one register left, they
> would still pass the length in it and only push the pointer on the stack).

They are created as a two field struct in GDC.

eg, delegates (D arrays are a little above)

which calls:

> The LDC x86_64 ABI implementation has had the following explanatory comment
> since it was originally written in 2009:
> > This helps make things like printf("%.*s", o.toString()) work as expected; 
> > if we didn't do this that wouldn't work if there were 4 other 
> > integer/pointer arguments before the toString() call because the string got 
> > bumped to memory with one integer register still free.

"%*.s" works purely out of coincidence.  You should not rely on it working at
all - and if you are, you should really instead be fixing your program.


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

Reply via email to