Re: int C function

2011-10-01 Thread Andrej Mitrovic
On 10/1/11, bearophile wrote: > I think it didn't perform a conversion, it just used to produce wrong code. Yes, poor wording on my part. > Is this in Bugzilla already? I can't recall. Doesn't hurt to file it if you can't find it.

Re: int C function

2011-10-01 Thread Ellery Newcomer
On 10/01/2011 08:33 AM, Andrej Mitrovic wrote: > On 10/1/11, Ellery Newcomer wrote: >> On 09/30/2011 08:20 PM, Andrej Mitrovic wrote: >>> I think this is a side-effect of the new function pointer fixes, where >>> you now can't implicitly convert an extern(C) function to an extern(D) >>> function b

Re: int C function

2011-10-01 Thread Andrej Mitrovic
On 10/1/11, Ellery Newcomer wrote: > On 09/30/2011 08:20 PM, Andrej Mitrovic wrote: >> I think this is a side-effect of the new function pointer fixes, where >> you now can't implicitly convert an extern(C) function to an extern(D) >> function by accident (and that's a good thing). But the problem

Re: int C function

2011-10-01 Thread bearophile
> Maybe a new future job for std.conv.to? (to convert a extern(C) func ponter > to extern(D) func pointer). This seems useless. Please ignore this. Bye, bearophile

Re: int C function

2011-10-01 Thread bearophile
Ellery Newcomer: > weird error. anyone know what's going on? It's a good error message. In DMD 2.056head gives an even better error message: test6.d(8): Error: function test6.X.tt (int function(const const(char*)) xz) is not callable using argument types (extern (C) int function(const const(cha

Re: int C function

2011-09-30 Thread Ellery Newcomer
On 09/30/2011 08:20 PM, Andrej Mitrovic wrote: > I think this is a side-effect of the new function pointer fixes, where > you now can't implicitly convert an extern(C) function to an extern(D) > function by accident (and that's a good thing). But the problem is, > you can't define a function with a

Re: int C function

2011-09-30 Thread Ellery Newcomer
On 09/30/2011 08:20 PM, Andrej Mitrovic wrote: > I think this is a side-effect of the new function pointer fixes, where > you now can't implicitly convert an extern(C) function to an extern(D) > function by accident (and that's a good thing). But the problem is, > you can't define a function with a

Re: int C function

2011-09-30 Thread Christophe
t; } > void main(){ > X x = new X(); > x.tt = &puts; > } > [ellery@localhost d]$ dmd test > test.d(8): Error: function test.X.tt (int function(const const(char*)) > xz) is not callable using argument types (int C function(const > const(char*) s)) > test.d(8):

Re: int C function

2011-09-30 Thread Andrej Mitrovic
I think this is a side-effect of the new function pointer fixes, where you now can't implicitly convert an extern(C) function to an extern(D) function by accident (and that's a good thing). But the problem is, you can't define a function with a different linkage type inline as a type parameter. You

int C function

2011-09-30 Thread Ellery Newcomer
function test.X.tt (int function(const const(char*)) xz) is not callable using argument types (int C function(const const(char*) s)) test.d(8): Error: cannot implicitly convert expression (& puts) of type int C function(const const(char*) s) to int function(const const(char*))