|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 0761 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 0761.
Report 0761 Actions
Problem Report Number 0761 Submitter's Classification Specification problem State Resolved Resolution Temporary Interpretation (TIN) Problem Resolution ID TIN.X.0052 Raised 1970-01-01 08:00 Updated 2003-03-13 08:00 Published 1995-09-09 08:00 Product Standard Commands and Utilities V2 (UNIX 95) Certification Program The Open Brand certification program Test Suite VSC version 4.1.4 Test Identification POSIX.upe/patch/patch 13 Specification Commands and Utilities Issue 4 Version 2 Location in Spec See Problem Text Problem Summary TIN4C.00009 Test of -D option should allow #ifndef use. Problem Text
Historically, patch's -D option has used both #ifdef and #ifndef
constructs. The IEEE interpretation PASC 1003.2-92 #69 states
that POSIX.2's failure to allow the use of both constructs is
a defect in the standard.
Our implementation conforms to the draft POSIX.2b standard which
more accurately describes historical behaviour in this area.
Since this area of the specification is subject to change, we
request a temporary interpretation allowing historical practice.Test Output
200|46 1 17:53:03|TP Start
520|46 1 462094346 1 1|Assertion #13 (C):
520|46 1 462094346 1 1|Note: The behavior associated with this assertion is expected
520|46 1 462094346 1 2|to change in a future revision of POSIX.2.
520|46 1 462094346 1 3|-TC13- Output differs from the expected output
220|46 1 1 17:53:12|FAILReview Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
pasc-1003.2-69 requests
POSIX.2 Subclause 5.22 specifies the semantics of the "patch" utility.
In subclause 5.22.3 the behavior of the -D option is specified as
follows:
-D <define> Mark changes with the C preprocessor construct:
#ifdef <define>
...
#endif
The option-argument <define> shall be used as the
differentiating symbol.
Can a conforming implementation of the patch utility use "#ifndef" to
mark changes that constitute deletions from the original file? Can an
implementation freely choose to use #ifdef or #ifndef when either is
correct (i.e. gives a file that, after preprocessing, has the correct
contents)? For example, the files
aa
#ifdef uppercase
BB
#else
bb
#endif
cc
and
aa
#ifndef uppercase
bb
#else
BB
#endif
cc
are equivalent in this sense. Are both valid output files from a call
to a conforming "patch -D uppercase ..."?
Note that the use of #ifndef is historical practice. Note also that if
it is not permitted, implementations can still conform, but only
through the use of such clumsy constructs as
#ifdef <define>
#else
...
#endif
In a similar vein: can a conforming implementation of "patch" use
the construct
#if defined(<define>)
rather than
#ifdef <define>
In general, how broadly can the phrase "the C preprocessor
construct:..." be interpreted?
And delivers the following ruling
The standard states the behaviour for #ifdef and #endif and conforming
implementations must conform to this. The standard makes no restrictions
for the use of further C preprocessor directives between #ifdef and #endif.
The standard does not allow using #ifndef and #if defined in the manner
specified in the interpretation request. Concerns about this are being
refered to the sponsor.
This would appear to disallow the requested use of #ifndef. However,
POSIX 1003.2b/D11 states
-D define Mark changes with one of the following C preprocessor
constructs:
#ifdef define
...
#endif
#ifndef define
...
#endif
optionally combined with the C preprocessor constrct #else
Anticipating acceptance of POSIX 2003.2b and the eventual
alignment of the tests with it a temporary interpretation is
recommended.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Temporary Interpretation (TIN) Review Conclusion
A Temporary Interpretation is granted.
Problem Reporting System Options:
- View Report 0761
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority