Bug 11168 – core.stdc.time.asctime() is incorrectly marked as @trusted
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-03T20:23:56Z
Last change time
2018-11-29T08:02:19Z
Assigned to
No Owner
Creator
Walter Bright
Comments
Comment #0 by bugzilla — 2013-10-03T20:23:56Z
https://github.com/D-Programming-Language/druntime/blob/master/src/core/stdc/time.d#L89
asctime() is not @trusted because it is allowed to return a non-shared pointer to shared data. It's also not reentrant - it'll produce mangled garbage if called from multiple threads. There's no way this can be marked as @trusted.
The similar functions in the same module need to be carefully reviewed.
Comment #1 by github-bugzilla — 2018-11-29T08:02:18Z