HomeAbout Us A-Z IndexSearch * Contact Us Register LoginPress Shop

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 0348 Details

Help Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges

This page provides all information on Problem Report 0348.


Report 0348 Actions


    Problem Report Number 0348
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Permanent Interpretation (PIN)
    Problem Resolution ID PIN.X.0064
    Raised 2003-02-12 08:00
    Updated 2003-03-13 08:00
    Published 2003-02-18 08:00
    Product Standard Internationalised System Calls and Libraries (XPG4)
    Certification Program The Open Brand certification program
    Test Suite VSX4 version 4.4.5
    Test Identification XPG4.os/time/strptime 3
    Specification System Interfaces and Headers Issue 4
    Location in Spec See Problem Text
    Problem Summary PIN4.064 The range for "struct tm" tm_sec of [0,61] comes from the original C standard which, mostly to be safe, allowed for up to two leap seconds in a minute. This range was reflected in the C standard strft...
    Problem Text
    The range for "struct tm" tm_sec of [0,61] comes from the original
    C standard which, mostly to be safe, allowed for up to two leap
    seconds in a minute. This range was reflected in the C standard
    strftime() and in the Open Group's strptime() routines for %S.

    The latest (1999) ISO C standard, after having done their homework,
    has determined that there will NEVER be more than one leap second
    in any minute. As such, its tm_sec range is reduced to [0,60] and
    that's all that its strftime() will emit for %S. See clauses 7.23.1
    and 7.23.3.2.

    Even though strptime() is an Open Group extension to the C standard
    "struct tm" routines, it has always been the mirror image to the
    strftime() routine. Now that tm_sec and strftime()'s %S no longer
    permits a 61, the Open Group strptime() %S must follow suit. And,
    the Open Group has always deferred to and followed the lead of the C
    standard regarding the behavior of its library routines.

    As C99 now restricts tm_sec to [0,60], failing to accept a match
    for 61 for strptime()'s %S must be permitted.
    Test Output
    ************************************************************************
    /tset/XPG4.os/time/strptime/T.strptime 3 Failed

    Test Description:
    If strptime() is supported:
    When format is a string made up of a series of the following field
    descriptors :
    a. d day of month - 01 to 31 (with or without leading zeros)
    b. D date in %m/%d/%y format
    c. H hour - 00 to 23 (with or without leading zeros)
    d. I hour - 00 to 12 (with or without leading zeros)
    e. j day of year - 001 to 366
    f. M minute - 00 to 59 (with or without leading zeros)
    g. m month of year - 01 to 12 (with or without leading zeros)
    h. n any whitespace character sequence
    i. r time in %I:%M:%S %p format
    j. S second - 00 to 61 (with or without leading zeros)
    k. t any whitespace character sequence
    l. T time in %H:%M:%S notation
    m. U week number of year - 00 to 53 (Sunday as first day of week)
    (with or without leading zeros)
    n. w day of week - 0 to 6 (Sunday = 0) (with or without leading
    zeros)
    o. W week number of year - 00 to 53 (Monday as first day of week)
    (with or without leading zeros)
    p. y last two digits of year - 00 to 99 (with or without leading
    zeros)
    q. Y four digit year including century
    then a call to strptime() reads characters from string and, in the
    case that these characters match the format of the directive,
    translates these characters into the appropriate member of the tm
    structure. Occurrences of "%%" in the format string are matched
    against a single "%" and do not affect the tm structure.
    Otherwise:
    A call to strptime() returns NULL and sets errno to ENOSYS.

    Test Strategy:
    PARENT process will
    CREATE child process using cppair()
    CHILD process will
    FOR each item in the assertion, and for fields with and without
    leading zeroes where allowed, and for locales VSX4L1 and VSX4L2
    where indicated:
    INITIALISE the tm structure to be set by strptime()
    INITIALISE the tm structure that strptime() will be checked
    against.
    IF testing the %p format:
    SET the locale for LC_TIME to VSX4L1 or VSX4L2
    OBTAIN the relevant pseudo-language data using pslanginfo()
    CONVERT the date and time string to a tm structure using
    strptime()
    VERIFY strptime() returns the expected tm structure.

    Test Information:
    seconds without leading zeroes
    strptime("61", "%S", &testbuf) failed.
    return value was NULL

    ************************************************************************

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    Although the XSH4 specification requires strptime() to accept
    a seconds value of 61, this is as a result of an acknowledged
    mistake in the 1989 C Standard regarding double leap seconds,
    which has since been rectified in the 1999 C Standard.
    It seems reasonable for implementations of strptime() not to
    accept a seconds value of 61, and so a Permanent Interpretation
    is recommended.

    Review Type SA Review
    Start Date null
    Completed null
    Status Complete
    Review Resolution Permanent Interpretation (PIN)
    Review Conclusion
    A Permanent Interpretation is granted.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority