Re: Calling C function with static array includes length and pointer

2010-06-21 Thread Ali Çehreli
mwarning wrote: > Anyway, the D spec says: > "Static arrays are value types, but as in C static arrays are passed to > functions by reference and cannot be returned from functions." > (http://www.digitalmars.com/d/1.0/arrays.html#static-arrays) I've been thinking D2. :) In D2, fixed-sized arrays

Re: Calling C function with static array includes length and pointer

2010-06-21 Thread mwarning
On Tue, 22 Jun 2010 00:00:27 +0200, torhu wrote: > On 21.06.2010 23:30, mwarning wrote: >> Hi, >> >> I try to pass a static array to a variadic C function. Looks like the >> array is passed by values as expected, but the length and pointer are >> prepended, too. Is this intentional or a bug? >> >>

Re: Calling C function with static array includes length and pointer

2010-06-21 Thread torhu
On 21.06.2010 23:30, mwarning wrote: Hi, I try to pass a static array to a variadic C function. Looks like the array is passed by values as expected, but the length and pointer are prepended, too. Is this intentional or a bug? http://pastebin.com/6ejFF37j I believe this works as intended. An

Re: Calling C function with static array includes length and pointer

2010-06-21 Thread mwarning
On Mon, 21 Jun 2010 14:38:50 -0700, Ali Çehreli wrote: > mwarning wrote: >> Hi, >> >> I try to pass a static array to a variadic C function. Looks like the >> array is passed by values as expected, but the length and pointer are >> prepended, too. Is this intentional or a bug? >> >> http://paste

Re: Calling C function with static array includes length and pointer

2010-06-21 Thread Ali Çehreli
mwarning wrote: Hi, I try to pass a static array to a variadic C function. Looks like the array is passed by values as expected, but the length and pointer are prepended, too. Is this intentional or a bug? http://pastebin.com/6ejFF37j Fixed sized arrays don't have ptr and length members: imp