Safer D is implemented!
Jonathan M Davis
newsgroup.d at jmdavisprog.com
Thu Nov 28 08:39:36 UTC 2024
On Thursday, November 28, 2024 12:08:29 AM MST Walter Bright via Digitalmars-
d-announce wrote:
> 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.
So, essentially, it makes functions with no explicit @safety attributes be
somewhere between @system and @safe by disallowing language constructs which
are considered @system but not disallowing calling @system functions.
- Jonathan M Davis
More information about the Digitalmars-d-announce
mailing list