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
Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/d25b1b23b8386d951025edd4fd2a8423ab550fce Fix Issue 11168: attributes for functions in `core.stdc.time`. https://github.com/dlang/druntime/commit/377f0483a3231790175fab7b12b619d22ee71fd9 Merge pull request #2372 from radcapricorn/fix11168 Fix Issue 11168: attributes for functions in core.stdc.time.