This bug submission is an FYI regarding another related report I have submitted in the source tracker against time.h having potentially incorrect range values ( see Bug 204529 - struct tm documentation in time.h possibly incorrect ). Since "man 3 gmtime" contains an excerpt of this struct verbatim, I opened a ticket in the event that Bug 204529 is accurate, which will cause an update to this man page.
Looking at time.h on Linux, I see struct tm { int tm_sec; /* Seconds. [0-60] (1 leap second) */ . . . int tm_yday; /* Days in year.[0-365] */ . . } So, it seems the 0-60 range is due to a leap second. I am assuming that the 0-365 range is due to leap year range also. Can notation regarding this be added to the gmtime man page to clarify this issue?
Created attachment 228609 [details] ctime(3) patch Document that tm_sec has a range of [0,60] to allow for leap seconds, and tm_yday has a range of [0,365] to allow for leap years.
This is a documentation issue, not an implementation issue.
*** Bug 204529 has been marked as a duplicate of this bug. ***
Patch is for a contrib/tzcode/stdtime/ctime.3