Bug 6644 – std.stdio write/writef(ln) are not @trusted
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-09-11T09:49:00Z
Last change time
2014-07-30T17:05:46Z
Keywords
pull, safe
Assigned to
rbanderton
Creator
dmitry.olsh
Comments
Comment #0 by dmitry.olsh — 2011-09-11T09:49:00Z
Surely @safe code should be able to write/read data via File.
Test case:
import std.stdio;
@safe void f()
{
writeln("Hello!");
}
dmd output:
Error: safe function 'f' cannot call system function 'writeln'
This is on dmd 2.055 release.
Comment #1 by dfj1esp02 — 2014-06-04T13:59:21Z
writeln will call toString on arguments, which may not be trusted.