DStep - Bindings Generator 0.0.1

Jacob Carlborg doob at me.com
Tue Jul 10 02:22:15 PDT 2012


On 2012-07-10 09:57, Andrea Fontana wrote:

> struct test
> {
> int var;
> };
>
> struct test* first();
>
> Dstep translate first() => first(...) in this case.

As far as I know that is legal C code is a variadic function. It's the 
old K&R style which is discouraged now but still legal:

http://en.wikipedia.org/wiki/ANSI_C#Compliance_detectability

If you want a function taking no arguments the correct syntax is:

struct test* first (void);

I don't know the best way to deal with that. It's legal C code but not 
legal D. I could check if there is no parameters and assume that's what 
the users wants but it's not correct. Perhaps I could provide a flag for 
this.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-announce mailing list