View Issue Details

IDProjectCategoryView StatusLast Update
0001612Issue 8 draftsSystem Interfacespublic2024-06-11 09:12
Reporterkre Assigned To 
PrioritynormalSeverityObjectionTypeError
Status ClosedResolutionAccepted As Marked 
Product VersionDraft 2.1 
NameRobert Elz
Organization
User Reference
SectionXSH 3/strftime
Page Number1997
Line Number64827
Final Accepted TextSee 0001612:0006048.
Summary0001612: XSH strftime() new (I8) %s conversion requires too much of the struct tm
Descriptionstrftime() says of the (newly added in Issue 8) %s conversion (lines 64826-7)

     Replaced by the number of seconds since the Epoch as a decimal number,
     calculated as described for mktime( ).

That is fine.

After that it adds (as with all other conversions) the fields of its struct tm
arg which are used by that conversion. For %s (line 64827) that says

    [all members]

That is incorrect. Checking XSH 3/mktime() we see (page 1311, lines 43852-3)

    The original values of the tm_wday and tm_yday components of
    the structure shall be ignored,

Hence, as the %s conversion is required to operate as specified for mktime()
and mktime() is prohibited from using tm_wday or tw_yday as part of its
calculation, it cannot possibly be necessary for those fields to be set
in a struct tm passed to strftime() for the %s conversion, hence it is
incorrect to say that all members must be set.

There is another potential problem, but that really occurs in mktime()
and so will be deferred to later issue report, related to it. Either
of the proposed resolutions below would avoid that problem (for the 2nd
alternative, provided the mktime() issue is fixed).

Desired ActionEither list the members that are used by mktime()

   tm_year tm_mon tm_mday tm_hour tm_min tm_sec and tm_isdst

instead of "all members", which would be consistent with the
other specifications,

or (since the algorithm does) simply defer to XSH 3/mktime via an
XREF in the brackets.

Either way works.
Tagsissue8

Relationships

parent of 0001797 Interpretation Required 1003.1(2024)/Issue8 strftime "%s" should be able to examine tm_gmtoff 
child of 0000169 Closedajosey 1003.1(2008)/Issue 7 date utility needs ``%s'' 

Activities

Don Cragun

2022-11-10 16:36

manager   bugnote:0006048

Change strftime() DESCRIPTION on P1997, L64827 from:
[all members]
to:
[tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_isdst]

Issue History

Date Modified Username Field Change
2022-11-03 11:19 kre New Issue
2022-11-03 11:19 kre Name => Robert Elz
2022-11-03 11:19 kre Section => XSH 3/strftime
2022-11-03 11:19 kre Page Number => 1997
2022-11-03 11:19 kre Line Number => 64827
2022-11-10 16:36 Don Cragun Note Added: 0006048
2022-11-10 16:37 Don Cragun Final Accepted Text => See 0001612:0006048.
2022-11-10 16:37 Don Cragun Status New => Resolved
2022-11-10 16:37 Don Cragun Resolution Open => Accepted As Marked
2022-11-10 16:37 Don Cragun Tag Attached: issue8
2022-11-30 16:48 geoffclare Status Resolved => Applied
2024-02-26 19:52 eblake Relationship added parent of 0001797
2024-02-26 19:54 eblake Relationship added child of 0000169
2024-06-11 09:12 agadmin Status Applied => Closed