Opened 16 years ago
Closed 15 years ago
Last modified 15 years ago
#5693 closed defect (fixed)
time_t var brokenDown might want to init tm_gmtoff and tm_zone
Reported by: | Owned by: | Isaac Richards | |
---|---|---|---|
Priority: | trivial | Milestone: | unknown |
Component: | mythtv | Version: | head |
Severity: | low | Keywords: | |
Cc: | Ticket locked: | no |
Description
Glibc (and supposedly *BSD libc) have additional struct members tm_gmtoff and tm_zone in time_t. There are also the members tm_wday and tm_yday (that every Unix has). They are not initialized in toTime_t.
Attachments (2)
Change History (8)
Changed 16 years ago by
Attachment: | programs_mythfilldatabase-uninit.patch added |
---|
comment:1 Changed 15 years ago by
Status: | new → infoneeded_new |
---|
Erik, I think that ::timezone and ::tzname[0] will return the localtime values instead of UTC, which from the naming of the secsSince1Jan1970UTC variable is what I assume we want. Would simply doing a bzero be appropriate in this case?
Changed 15 years ago by
Attachment: | programs_mythfilldatabase-uninit-ticket-5693.patch added |
---|
changes the initialization to conform to danielk's suggestion
comment:3 Changed 15 years ago by
I have resubmitted the patch to initialize those two fields with more sane values. Please keep the cast there as this is required for 64-bit correctness. This is because in C++ null evaluates to 0 which is then turned into a uint32_t. If it isn't cast then the compiler is welcome to put any bits it wants into the upper 32-bits on 64-bit OSes.
comment:4 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | infoneeded_new → closed |
comment:5 Changed 15 years ago by
I kept the cast, but I think any compiler that didn't handle NULL appropriately would be taken out and tarred :)
comment:6 Changed 15 years ago by
I hear you. But this is a C++ issue. Just look on the intertubes for gcc and sentinel warnings.
init some more struct member vars in toTime_t