]> Savannah Git Hosting - gnulib.git/commitdiff
wmemcmp: Add tests.
authorBruno Haible <bruno@clisp.org>
Wed, 19 Apr 2023 00:10:23 +0000 (02:10 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 19 Apr 2023 00:10:23 +0000 (02:10 +0200)
* tests/test-wmemcmp.c (main): Add comment.

tests/test-wmemcmp.c

index 998dff26534c95aee315ba45272a1090068b4f23..3a85acebf3af7a7989619a7f61164f6a69faa3e6 100644 (file)
@@ -63,7 +63,11 @@ main (int argc, char *argv[])
     ASSERT (wmemcmp (input2, input1, 4) > 0);
   }
 
-  /* ISO C requires wmemcmp to work with all wchar_t values.  */
+  /* ISO C requires wcscmp to work with all wchar_t values.
+     ISO C 17 ยง 7.29.4.4 says:
+       "Unless explicitly stated otherwise, the functions described in this
+        subclause order two wide characters the same way as two integers of
+        the underlying integer type designated by wchar_t."  */
   {
     static const wchar_t input1[] = { (wchar_t) 0x76547654 };
     static const wchar_t input2[] = { (wchar_t) 0x9abc9abc };