Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000724 [1003.1(2013)/Issue7+TC1] System Interfaces Editorial Clarification Requested 2013-07-18 09:57 2019-06-10 08:55
Reporter geoffclare View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Geoff Clare
Organization The Open Group
User Reference
Section mktime
Page Number 1316
Line Number 43523-43527
Interp Status ---
Final Accepted Text See Note: 0001689.
Summary 0000724: mktime() tm_yday contradiction
Description The mktime() description says:

    The original values of the tm_wday and tm_yday components of
    the structure are ignored.

Later, it says (in CX shading):

    The relationship between the tm structure (defined in the <time.h>
    header) and the time in seconds since the Epoch is that the result
    shall be as specified in the expression given in the definition of
    seconds since the Epoch (see XBD Section 4.15, on page 113)
    corrected for timezone and any seasonal time adjustments, where
    the names in the structure and in the expression correspond.

Since the expression in XBD 4.15 uses tm_yday, this paragraph requires
tm_yday to be used in the calculation of the time in seconds since the
Epoch, contradicting the earlier statement that tm_yday is ignored.
However, the earlier statement is from the C Standard and therefore
"wins" over the CX-shaded paragraph (and the necessary correction
should therefore be considered editorial).

An additional editorial correction is that some uses of the present
tense (from the C Standard) should change to use "shall".
Desired Action At page 1316 line 43515 change:

    The original values of the tm_wday and tm_yday components of
    the structure are ignored, and the original values of the other
    components are not restricted to the ranges described in <time.h>.

to:

    The original values of the tm_wday and tm_yday components of
    the structure shall be ignored, and the original values of the
    other components shall not be restricted to the ranges described
    in <time.h>.

At page 1316 line 43526 change:

    where the names in the structure and in the expression correspond

to:

    where the names other than tm_yday in the structure and in the
    expression correspond, and the tm_yday value used in the expression
    is the day of the year from 0 to 365 inclusive, calculated from the
    other members of the tm structure (excluding tm_wday).

(This all follows a "shall", so present tense is okay.)

At page 1316 line 43529 change:

    and the other components are set to represent the specified time

to:

    and the other components shall be set to represent the specified time
Tags tc2-2008
Attached Files

- Relationships

-  Notes
(0001682)
dalias (reporter)
2013-07-18 15:05

I don't believe that the current language is wrong, just slightly ambiguous. The relationship described is true between the resulting struct tm and the return value.

Also, I object to the text "where the names other than tm_yday in the structure and in the expression correspond, and the tm_yday value used in the expression is the day of the year from 0 to 365 inclusive, calculated from the other members of the tm structure (excluding tm_wday)." Many implementations have members other than the standard ones (e.g. tm_gmtoff) in their struct tm, and use of these other members by mktime to compute the result is not permissible. If the fix for this issue is to refer to other members, it should refer explicitly to the list of members the result is permitted to depend upon.

Alternatively, the if there's a simple way of qualifying the condition that the input and output struct tm refer to the same time, the fix could simply mandate that they do, and that the return value correspond to the resulting struct tm (as opposed to the original one) according to the formula in XBD 4.15.
(0001689)
geoffclare (manager)
2013-07-19 09:39

Revised proposal that takes into account the non-standard members
problem identified in Note: 0001682...

At page 1316 line 43515 change:

    The original values of the tm_wday and tm_yday components of
    the structure are ignored, and the original values of the other
    components are not restricted to the ranges described in <time.h>.

to:

    The original values of the tm_wday and tm_yday components of
    the structure shall be ignored, and the original values of the
    other components shall not be restricted to the ranges described
    in <time.h>.

At page 1316 line 43526 change:

    where the names in the structure and in the expression correspond

to:

    where the names other than tm_yday in the structure and in the
    expression correspond, and the tm_yday value used in the expression
    is the day of the year from 0 to 365 inclusive, calculated from the
    other tm structure members specified in <time.h> (excluding tm_wday).

(This all follows a "shall", so present tense is okay.)

At page 1316 line 43529 change:

    and the other components are set to represent the specified time

to:

    and the other components shall be set to represent the specified time

- Issue History
Date Modified Username Field Change
2013-07-18 09:57 geoffclare New Issue
2013-07-18 09:57 geoffclare Name => Geoff Clare
2013-07-18 09:57 geoffclare Organization => The Open Group
2013-07-18 09:57 geoffclare Section => mktime
2013-07-18 09:57 geoffclare Page Number => 1316
2013-07-18 09:57 geoffclare Line Number => 43523-43527
2013-07-18 09:57 geoffclare Interp Status => ---
2013-07-18 15:05 dalias Note Added: 0001682
2013-07-19 09:39 geoffclare Note Added: 0001689
2013-08-01 15:29 Don Cragun Final Accepted Text => See Note: 0001689.
2013-08-01 15:29 Don Cragun Status New => Resolved
2013-08-01 15:29 Don Cragun Resolution Open => Accepted As Marked
2013-08-01 15:29 Don Cragun Tag Attached: tc2-2008
2019-06-10 08:55 agadmin Status Resolved => Closed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker