Report 1599 Actions
Problem Report Number |
1599 |
Submitter's Classification |
Specification problem |
State |
Resolved |
Resolution |
Permanent Interpretation (PIN) |
Problem Resolution ID |
PIN.X.0156 |
Raised |
1996-02-20 08:00 |
Updated |
2003-03-13 08:00 |
Published |
1996-03-19 08:00 |
Product Standard |
Internationalised System Calls and Libraries Extended (UNIX 95) |
Certification Program |
The Open Brand certification program |
Test Suite |
VSU version 4.1.0 |
Test Identification |
CAPI.os/string/strncasec 4 |
Specification |
System Interfaces and Libraries Issue 4 Version 2 |
Location in Spec |
See Problem Text |
Problem Summary |
PIN4U.00022 This test may fail on implementations which do not use the ASCII character set. |
Problem Text |
This test may fail on implementations which do not use the ASCII character set.
The strcasecmp() and strncasecmp() spec pages state
These functions assume the ASCII character set when equating lower and upper case characters. In the POSIX locale, strcasecmp() and strncasecmp() do upper to lower conversions, then a byte comparison. The results are unspecified in other locales.
We believe was not the original intent of the standard.
By mentioning ASCII, the standard is preventing a portable implementation of strncasecmp() on non-ASCII platforms.
XBD Section 4.4 pg. 41, last paragraph states
This document set assumes that the portable character set is constant across all locales, but does not prohibit implementations from supporting two incompatible encodings such as ASCII and EBCIDIC.
We believe that the ASCII requirement does not follow in the spirit of this passage since it reduces the portability of the function, and is preventing proper support of the incompatible encodings by requiring ASCII.
We suggest that the strcasecmp() spec wording be made consistent with the tolower()/toupper() spec wording by changing the excerpt above to the following:
These functions equate lower and upper case characters based on the character type information in the program locale category LC_CTYPE.
The See Also section should be modified to refer to setlocale() in addition to <strings.h>
|
Test Output |
400|0 4 1 10:48:39|IC Start 200|0 4 10:48:39|TP Start 520|0 4 40960012 1 1|SPEC1170TESTSUITE CASE 4 520|0 4 40960012 1 2|A call to int strncasecmp(const char *s1, const cha 520|0 4 40960012 1 3|*s2, size_t n) shall assume the ASCII character set 520|0 4 40960012 1 4|when equating lower and upper case characters. 520|0 4 10420239 1 1|PREP: Set locale to POSIX 520|0 4 10420239 1 2|PREP: Set POSIX locale 520|0 4 10420239 1 3|TEST: strncasecmp uses ASCII character set 520|0 4 10420239 1 4|ERROR: ASCII not used. Neither strncasecmp("AbC","\141\142\143",1) 520|0 4 10420239 1 5| nor strncasecmp("AbC","\101\102\103",1) equal zero 520|0 4 10420239 1 6|ERROR: ASCII not used. Neither strncasecmp("AbC","\141\142\143",2) 520|0 4 10420239 1 7| nor strncasecmp("AbC","\101\102\103",2) equal zero 520|0 4 10420239 1 8|ERROR: ASCII not used. Neither strncasecmp("AbC","\141\142\143",3) 520|0 4 10420239 1 9| nor strncasecmp("AbC","\101\102\103",3) equal zero 520|0 4 10420239 1 10|ERROR: ASCII not used. Neither strncasecmp("AbC","\141\142\143",4) 520|0 4 10420239 1 11| nor strncasecmp("AbC","\101\102\103",4) equal zero 520|0 4 10420239 1 12|ERROR: ASCII not used. Neither strncasecmp("AbC","\141\142\143",5) 520|0 4 10420239 1 13| nor strncasecmp("AbC","\101\102\103",5) equal zero 520|0 4 10420239 1 14|ERROR: ASCII not used. Neither strncasecmp("AbC","\141\142\143",6) 520|0 4 10420239 1 15| nor strncasecmp("AbC","\101\102\103",6) equal zero 520|0 4 10420239 1 16|ERROR: ASCII not used. Neither strncasecmp("AbC","\141\142\143",7) 520|0 4 10420239 1 17| nor strncasecmp("AbC","\101\102\103",7) equal zero 220|0 4 1 10:48:40|FAIL 410|0 4 1 10:48:41|IC End
|
Review Information
Review Type |
TSMA Review |
Start Date |
null |
Completed |
null |
Status |
Complete |
Review Recommendation |
No Resolution Given |
Review Response |
This isn't really a grey area as the spec clearly states
These functions assume the ASCII character set when equating lower and upper case characters.
But the request has merit and we recommend it be sent to the base working group for resolution.
|
Review Type |
Expert Group Review |
Start Date |
null |
Completed |
null |
Status |
Complete |
Review Resolution |
No Resolution Given |
Review Conclusion |
The intent of the specification is not to require an ASCII encoding when performing a comparison.
|
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:
|