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

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 1930 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 1930.


Report 1930 Actions


    Problem Report Number 1930
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Rejected (REJ)
    Problem Resolution ID REJ.X.0566
    Raised 2002-02-07 08:00
    Updated 2003-03-13 08:00
    Published null
    Product Standard Internationalised System Calls and Libraries Extended V2 (UNIX 98)
    Certification Program The Open Brand certification program
    Test Suite VSX4 version 4.4.5
    Test Identification ANSI.os/streamio/vsnprintf 68
    Problem Summary PG5R.009 The behavior of vsnprintf in IRIX was in compliace with UNIX95 standards as, Upon successful completion, these functions return the number of bytes transmitted excluding the terminating null in the ca...
    Problem Text

    The behavior of vsnprintf in IRIX was in compliace with UNIX95
    standards as,

    Upon successful completion, these functions return the number of bytes
    transmitted excluding the terminating null in the case of sprintf() or
    snprintf() or a negative value if an output error was encountered.

    But in bwg98-0006 it was changed to

    Upon successful completion, the snprintf() function
    returns the number of bytes that would be written to s
    had n been sufficiently large excluding the terminating
    null byte.

    Change this behavior would cause compatibility problem for IRIX.

    Test Output
    vsnprintf(buf, 3, "%s", {"abc"}) returned 2, expected 3
    vsnprintf(buf, 5, "1234567890", {}) returned 4, expected 10

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    When bwg98-006 was discussed by the Base Working Group there were
    only two known existing behaviours of [v]snprintf() when the buffer
    is not large enough. One was the behaviour now required by XSH5
    as amended by bwg98-006, the other was a return value of -1.

    It is not clear whether the submitter claims his system's behaviour
    dates back to the time when bwg98-006 was being discussed, or whether
    it was implemented later on. (He mentions UNIX95 but this must be a
    typo for UNIX98, since snprintf() was not in UNIX95.) If this was
    indeed a third existing behaviour that was overlooked during the
    discussions, then it raises the question of whether the resolution
    might have been different if it had been known. I doubt very much
    if the resolution would have been different, as this behaviour (which
    is the same as the one in the original XSH5 description) was considered
    to be seriously flawed by all who participated in the discussion.

    The submitter states that changing to the behaviour required by
    bwg98-006 would cause compatibility problems for his system. This is
    not necessarily true - it depends on how the change is implemented.
    It is common in such cases to provide two different versions of the
    function, one which is backwards compatible and one which conforms to
    the standards. The choice of which version is used by applications
    is made by examining the feature test macros (or other compiler flags)
    used when the application is built.

    The behaviour required by bwg98-006 is the same one that is required
    by the 1999 C Standard and the 2001 revision of POSIX.1. Therefore
    the submitter will have to implement a version of [v]snprintf() which
    behaves this way at some point. Granting a permanent interpretation
    to allow an alternative behaviour for UNIX98 would only postpone the
    inevitable. (If the submitter needs some time to implement the new
    behaviour, then he can request a temporary waiver on the grounds of
    a minor system fault.)

    It is recommended that this request is refused.

    Review Type SA Review
    Start Date null
    Completed null
    Status Complete
    Review Resolution Rejected (REJ)
    Review Conclusion
    This request is refused.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority