Safer D is implemented!
Andrej Mitrovic
andrej.mitrovich at gmail.com
Sun Dec 29 12:22:42 UTC 2024
On Thursday, 28 November 2024 at 07:08:29 UTC, Walter Bright
wrote:
> https://github.com/dlang/dmd/pull/17044
>
> It's enabled with -preview=safer
>
I think this is going to still cause issues with dependencies,
which might just be a dub problem but I'm not sure.
For example I've tried to add `dflags `-preview=safer` to my
dub.sdl and now I get errors from 3rd party libraries:
```
lib\bindbc-glfw\source\bindbc\glfw\binddynamic.d(326,24): Error:
`name.ptr` cannot be used in `@safe` code, use `&name[0]` instead
lib\bindbc-glfw\source\bindbc\glfw\binddynamic.d(342,33): Error:
`@safe` function `loadGLFW` cannot access `__gshared` data
`glfwInit`
lib\bindbc-glfw\source\bindbc\glfw\binddynamic.d(342,20): Error:
cast from `extern (C) int function() nothrow @nogc*` to `void**`
not allowed in safe code
lib\bindbc-glfw\source\bindbc\glfw\binddynamic.d(343,33): Error:
`@safe` function `loadGLFW` cannot access `__gshared` data
`glfwTerminate`
lib\bindbc-glfw\source\bindbc\glfw\binddynamic.d(343,20): Error:
cast from `extern (C) void function() nothrow @nogc*` to `void**`
not allowed in safe code
lib\bindbc-glfw\source\bindbc\glfw\binddynamic.d(344,33): Error:
`@safe` function `loadGLFW` cannot access `__gshared` data
`glfwGetVersion`
```
Still it's a great step forward, thanks for your work~
More information about the Digitalmars-d-announce
mailing list