Submitter:Fred J. Tydeman
Document: WG14 N1944
188.8.131.52 strcoll makes the assumption that the result of comparing two strings can only have one of three outcomes: greater than, equal to, or less than. However, there is a fourth outcome that is possible: not comparable.
I have been told that there are locales or codesets that have strings of bytes that do not form valid characters. Those invalid characters could be considered Not-a-Character (similar to Not-a-Number for floating-point). And, they are not comparable to anything.
I do not know if the same issue can apply to wchar_t. If so, then 184.108.40.206.1 wcscmp(), 220.127.116.11.3 wcsncmp(), and 18.104.22.168.5 wmemcmp() have the same problem.
Suggested Technical Corrigendum
Replace the start of 22.214.171.124, paragraph 3,
The strcoll ...
If either string contains invalid characters, errno is set to an implementation defined value and the return value is unspecified; otherwise, errno is left alone and the strcoll ...
The same change should also be applied to 126.96.36.199.2 wcscoll.