[phobos] Making std.stdio.readf @safe

Andrei Alexandrescu via phobos phobos at puremagic.com
Tue Feb 7 12:04:51 PST 2017


On 2/7/17 2:07 PM, Jakub Łabaj via phobos wrote:
> I see it like this:
> - flockfile - can be @trusted, because no matter when we call it with
> correct argument, it won't do anything unsafe

affirmative

> - funlockfile - if called by not owning thread, the behaviour is
> undefined - so potentially may do something unsafe (I don't know what
 > happens if called on not locked file, probably is ignored)

affirmative - in C "undefined" implies "unsafe"

> fgetc - when not guarded by lock it is not thread safe, shouldn't be
> @trusted

I think you mean fgetc_unlocked? fgetc issues its own locking and unlocking.


Andrei


More information about the phobos mailing list