Memory safe in D

Nick Treleaven nick at geany.org
Fri Mar 22 10:13:49 UTC 2024


On Monday, 18 March 2024 at 21:10:40 UTC, Timon Gehr wrote:
> ```d
> import std.stdio;
> void main(){
>     bool b = void;
>     if(b) writeln("yes");
>     if(!b) writeln("no");
> }
> ```

The spec was updated:

> For a bool, only 0 and 1 are safe values.

https://dlang.org/spec/function.html#safe-values

The implementation still needs to make this an error:
https://github.com/dlang/dmd/pull/15362


More information about the Digitalmars-d mailing list