Safer D is implemented!

Walter Bright newshound2 at digitalmars.com
Thu Nov 28 07:08:29 UTC 2024


https://github.com/dlang/dmd/pull/17044

It's enabled with -preview=safer

It enables "safe by default". This is different from marking functions as @safe, 
in that:

1. it does not mark the function as @safe, the function mangling does not change

2. it enables all @safe checks except it does not complain about calling @system 
functions

3. it does not interfere with attribute inference

In other words, it does not impose transitive safety. You can still call 
malloc() and printf() in it.

Once it appears in the next release, I encourage people to add -preview=safer to 
their build process.


More information about the Digitalmars-d-announce mailing list