|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 0236 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 0236.
Report 0236 Actions
Problem Report Number 0236 Submitter's Classification Test Suite problem State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.0236 Raised 1995-09-07 08:00 Updated 2003-03-13 08:00 Published 1995-09-11 08:00 Product Standard Internationalised System Calls and Libraries (XPG4) Certification Program The Open Brand certification program Test Suite VSX4 version 4.3.5 Test Identification XPG4.os/genuts/getopt 4 Linked Problem Reports TSD4.209, (in, old, system) Problem Summary TSD4.236 The reason why stderr cannot be re-opened is that the suite is using freopen() in a non-portable manner. Before the freopen() is attempted, the FILE* object representing stderror is closed with fclose... Problem Text
The reason why stderr cannot be re-opened is that the suite is using
freopen() in a non-portable manner. Before the freopen() is
attempted, the FILE* object representing stderror is closed with
fclose(). On some platforms, this makes it impossible to re-open the
stream. Section 4.9.5.4 of the C standard states:
"The {freopen} function opens the file whose name is the string
pointed to by {filename} and associates the stream pointed to
by {stream} with it."
A stream that has been closed can no longer be considered a valid stream
and should not be passed to freopen(). From section 4.9.3 of the C
standard:
"The value of a pointer to a {FILE} object is indeterminate
after the associated file is closed ..."
An implementation may choose to implement streams in such a way that the
storage previously allocated to the stream structures is no longer
accessible. Operations on the pointer that used to point to the stream
can cause unpredictable results.
Only vaalid streams which are currently open should be passed to
freopen(). Put another way, a file cannot be "re-opened" if it wasn't
"open" to begin with.
This test should be modified so that stderr is not closed before it is
re-opened. This same misuse of freopen() is seen in other tests of
getopt but this is the only failure obtained.Test Output
***********************************************************************
/tset/XPG4.os/genuts/getopt/T.getopt 4 Unresolved
Test Description:
The formats of the diagnostics printed to standard error by a call to
getopt() in the POSIX locale are as follows:
"%s: illegal option -- %c\n", <program name>, <option character>
"%s: option requires an argument -- %c\n", <program name>, <option
character>
Test Information:
getopt() : Possibly incorrect diagnostic output to standard error:-
Expected diagnostic output :-
pname: illegal option -- a.
Actual diagnostic output :-
EDC7005E The getopt() function detected an invalid option
character a when it was invoked from program pname .
Cannot re-open stderr to ./errfile
***********************************************************************Review Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
It is agreed that this is a test suite fault and a waiver is recommended
on the grounds of a Test Suite Deficiency.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Test Suite Deficiency (TSD) Review Conclusion
This is an agreed Test Suite Deficiency.
Problem Reporting System Options:
- View Report 0236
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority