[newlib-cygwin/main] newlib: testsuite: twctype.c: U+0967 is a digit, not a letter

Jeff Johnston jjohnstn@sourceware.org
Sat Oct 17 02:25:47 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=efd0fac8ca99949db2a5b404b097e064f683ce33

commit efd0fac8ca99949db2a5b404b097e064f683ce33
Author: Bernie Innocenti via Newlib <newlib@sourceware.org>
Date:   Thu Oct 15 22:33:43 2026 +0900

    newlib: testsuite: twctype.c: U+0967 is a digit, not a letter
    
    Since newlib generates its character classes from Unicode data,
    iswalpha() is true only for letter categories.  U+0967 (DEVANAGARI DIGIT
    ONE) is a decimal digit, so it is alphanumeric but not alphabetic, and the
    test has failed on every target that runs the multibyte branch.  Check a
    Devanagari letter instead, and what U+0967 is classified as.
    
    Assisted-by: Claude:claude-opus-5-5 claude-code
    Signed-off-by: Bernie Innocenti <bernie@codewiz.org>

Diff:
---
 newlib/testsuite/newlib.wctype/twctype.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/newlib/testsuite/newlib.wctype/twctype.c b/newlib/testsuite/newlib.wctype/twctype.c
index d45128e50..8ad4ae635 100644
--- a/newlib/testsuite/newlib.wctype/twctype.c
+++ b/newlib/testsuite/newlib.wctype/twctype.c
@@ -37,7 +37,9 @@ int main()
   else
     {
       setlocale (LC_CTYPE, "C-UTF-8");
-      CHECK (iswalpha(0x0967));
+      CHECK (iswalpha(0x0905));
+      CHECK (!iswalpha(0x0967));
+      CHECK (iswalnum(0x0967));
       CHECK (!iswalpha(0x128e));
 #if __SIZEOF_WINT_T__ > 2
       /* These two lines may cause compilation warnings on targets


More information about the Newlib-cvs mailing list