[Issue 14125] std.file has gotten out of hand
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Feb 4 17:33:22 PST 2015
https://issues.dlang.org/show_bug.cgi?id=14125
--- Comment #27 from Walter Bright <bugzilla at digitalmars.com> ---
For example, Line 213:
static trustedCloseHandle(HANDLE hObject) @trusted
{
return CloseHandle(hObject);
}
All this is doing is redefining an @system function as being @trusted, without
changing the interface to it, or checking, or doing anything at all to justify
it now being trusted.
It may be true that CloseHandle() actually is trustworthy - if that is the
case, the declaration of CloseHandle() needs to change from @system to
@trusted. On the other hand, if it is not trustworthy, papering it over with
such a wrapper and relying on the caller to use it correctly by convention has
the effect of totally defeating the compiler's ability to check code.
--
More information about the Digitalmars-d-bugs
mailing list