Interfacing with C in 2.066.1
fra via Digitalmars-d
digitalmars-d at puremagic.com
Sat Nov 8 10:28:48 PST 2014
On Saturday, 8 November 2014 at 10:19:19 UTC, John Colvin wrote:
> On Saturday, 8 November 2014 at 10:03:51 UTC, Jason den Dulk
> wrote:
>> When upgrading my compiler from 2.065 to 2.066.1 I have
>> encountered problems with some of my extern(C) code.
>>
>> My declarations (in a .di file) are wrapped in an extern(C)
>> declaration. The code compiled fine in 2.065. In 2.066.1 it
>> first complained about functions returning "const char *"
>> ("function without this cannot be const").
>
> const char* foo() {}
>
> is a function that takes a const 'this' reference and returns
> char*
> You want
> const(char)* foo() {}
> or
> const(char*) foo() {}
Oh look, is THIS AGAIN. :(
More information about the Digitalmars-d
mailing list