all OS functions should be "nothrow @trusted @nogc"

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 26 06:29:26 PDT 2017


On Wednesday, 26 July 2017 at 02:54:34 UTC, Walter Bright wrote:
> * Operating system APIs grow like weeds. We'd set ourselves an 
> impossible task.
>
> It is worthwhile, however, to augment the APIs with the 
> appropriate attributes like @nogc, scope, nothrow, @safe (for 
> the ones that are), etc.

Given that C and OS api have no notion of memory safety, they 
don't support it and don't maintain it, so if it once was safe, 
it can be refactored later and become unsafe relying on proper 
usage of the api. Then if it was marked safe, the qualifier must 
be removed, which will be a breaking change for D code, but not 
for C code. Should we still try to mark them safe at all?


More information about the Digitalmars-d mailing list