Bug 6450 – struct tm definition too short in std.c.linux.linux
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D1 (retired)
Platform
Other
OS
Linux
Creation time
2011-08-07T11:59:34Z
Last change time
2017-10-03T07:10:38Z
Assigned to
No Owner
Creator
Graham
Comments
Comment #0 by grahamc001uk — 2011-08-07T11:59:34Z
The struct tm definition in module std.c.linux.linux line 276 is 11 integers (44 bytes) in size. The gmtime_r() function in the x86_64 standard C library fills in 56 bytes of data. There appears to be a mismatch in the structure definitions.
DMD64 D Compiler v1.069
Comment #1 by razvan.nitu1305 — 2017-10-03T07:10:38Z
The code in the initial bug report has been moved to druntime in src/core/stdc/time.d and it seems to implement the tm struct according to the one in glibc. After looking into the gtime_r function in glibc it looks like it does initialize the tm struct values, but it uses some other internal variables, so maybe it does fill 56 bytes of data, but not all are belonging to the tm struct.
Closing as invalid. Reopen if I am missing something.