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~
  • Safer D is im... Walter Bright via Digitalmars-d-announce
    • Re: Safe... Jonathan M Davis via Digitalmars-d-announce
    • Re: Safe... Walter Bright via Digitalmars-d-announce
      • Re: ... f via Digitalmars-d-announce
        • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-announce
        • ... Sergey via Digitalmars-d-announce
    • Re: Safe... Duan Tihua via Digitalmars-d-announce
    • Re: Safe... Andrej Mitrovic via Digitalmars-d-announce
    • Re: Safe... Andrej Mitrovic via Digitalmars-d-announce
      • Re: ... Andrej Mitrovic via Digitalmars-d-announce

Reply via email to