Safety, undefined behavior, @safe, @trusted

bearophile bearophileHUGS at lycos.com
Thu Nov 5 12:55:03 PST 2009


Walter Bright:

> I agree. Also, dealing with safeness is something that comes later on as 
> a project scales to a larger size. As such, it's more of a nuisance on a 
> small program than a help.

I don't know. In modern languages safety is a starting point. Things are safe unless defined otherwise. In C# default is for safety.


> Right. Adding:
> 
>     @safe:
> 
> at the top will do it.

See my first answer to this thread.

And the same can be said about a modifier 'unsafe' that applies to the whole code of a module. So half of Tango will compile again.

Bye,
bearophile



More information about the Digitalmars-d mailing list