Bug 16218 – Windows std.file.readImpl should be marked @system
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2016-06-29T10:30:55Z
Last change time
2021-08-02T21:04:22Z
Keywords
pull, safe, trivial
Assigned to
Vlăduț Chicoș
Creator
Steven Schveighoffer
Comments
Comment #0 by schveiguy — 2016-06-29T10:30:55Z
For some reason, the function is split into 90% islands of @trusted code, there is very little actual @safe code in there. In addition, the function shouldn't actually be @trusted, as it takes a null-terminated string. Better to mark it @system, and mark the uses of it @trusted (or mark the whole thing @trusted, and change the API to take a string array).
Comment #1 by dlang-bot — 2021-08-01T12:19:26Z
@vladchicos created dlang/phobos pull request #8184 "[DSSv3] Fix Issue 16218 - Windows std.file.readImpl should be marked @system" fixing this issue:
- Fix Issue 16218 - Windows std.file.readImpl should be marked @system.
https://github.com/dlang/phobos/pull/8184
Comment #2 by dfj1esp02 — 2021-08-02T11:55:44Z
The "private @trusted" pattern is sort of a gray zone, it's used here for safety inference. If readImpl was @system, all users will have to carefully infer attributes, which is error-prone. That said, the huge trusted islands make no sense indeed, whole readImpl should be a normal @trusted function, like the posix variant. It takes a pointer, because tempCString returns a voldemort type which is needlessly templated on the source range type.
BTW messing with trusted code is a rather cruel task for DSS.
Comment #3 by dlang-bot — 2021-08-02T21:04:22Z
dlang/phobos pull request #8184 "[DSSv3] Fix Issue 16218 - Windows std.file.readImpl should be marked @system" was merged into master:
- f3be11dc2930cd6f500ec816f426de9b98c84eec by vladchicos:
Fix Issue 16218 - Windows std.file.readImpl should be marked @system.
https://github.com/dlang/phobos/pull/8184