Report 1628 Actions
Problem Report Number |
1628 |
Submitter's Classification |
Test Suite problem |
State |
Resolved |
Resolution |
Permanent Interpretation (PIN) |
Problem Resolution ID |
PIN.X.0185 |
Raised |
1998-02-17 08:00 |
Updated |
2003-03-13 08:00 |
Published |
1998-03-20 08:00 |
Product Standard |
Internationalised System Calls and Libraries Extended V2 (UNIX 98) |
Certification Program |
The Open Brand certification program |
Test Suite |
VSU version 5.0.2 |
Test Identification |
CAPI.hdr/misc/netdb 18 |
Specification |
System Interfaces and Headers Issue 5 |
Location in Spec |
See Problem Text |
Problem Summary |
PIN4U.00051 This IR claims that macro definition is allowable in lieu of a declaration. |
Problem Text |
The XPG5 XNS spec states the following in the netdb.h section on page 211:
"<netdb.h> header provides a declaration a declaration of h_errno as a modififiable l-value of type int. For example:
extern int h_errno; "
The testcase is being too strict in it's interpretation of the requirements of the spec.
Our implementation defines in netdb.h, the following code:
extern void *h_errno_which(void); #define h_errno (*(int *)h_errno_which())
This defines h_errno to be a dereferenced int pointer, which is both a modifiable l-value and type int. To verify this, review the following test program:
#include <netdb.h> int main() { h_errno = 5; h_errno = 7; }
This compiles and runs without error, indicating that "h_errno" is modifiable and an l-value. The compilation line is:
c89 -D_XOPEN_SOURCE=500 herrnotest.c -o herrnotest
The last sentence of the "DESCRIPTION" section above explicitly allows this, and in our opinion shows the expectation of such a definition.
|
Test Output |
TEST CASE: netdb.h
TEST PURPOSE #18 The variable h_errno shall be declared in netdb.h. ERROR: h_errno not defined 18 FAIL
|
Review Information
Review Type |
TSMA Review |
Start Date |
null |
Completed |
null |
Status |
Complete |
Review Recommendation |
No Resolution Given |
Review Response |
We recommend this request be refused.
The text of the standard specifies a declaration of h_errno, and not a macro definition. Although this may be consistent with the intent of the spec, it is not consistent with the text. Since the spec specifies a declaration we believe the test is correct in requiring a variable be declared. A macro definition does not fulfill that requirement.
If the standard is believe to be too strict, then a change in the spec is needed to properly reflect the actual intent. To allow this behavior the spec must be changed to allow a macro definition, and a PIN should be applied for with the associated review.
|
Review Type |
SA Review |
Start Date |
null |
Completed |
null |
Status |
Complete |
Review Resolution |
No Resolution Given |
Review Conclusion |
This request should go for a 14 day review.
|
Review Type |
Expert Group Review |
Start Date |
null |
Completed |
null |
Status |
Complete |
Review Resolution |
No Resolution Given |
Review Conclusion |
It was always intended that the specification of h_errno in XNS5 should allow it to be defined as a macro. The use of the word "declaration" rather than "definition" appears to introduce some confusion, but it is nevertheless reasonably clear that a macro definition is allowable. The request should be granted.
|
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:
|