On FreeBSD 14.0/powerpc64 I am seeing these test failures in a testdir of all of gnulib:
FAIL: test-c32isalnum.sh FAIL: test-c32isalpha.sh FAIL: test-c32isblank.sh FAIL: test-c32iscntrl.sh FAIL: test-c32isdigit.sh FAIL: test-c32islower.sh FAIL: test-c32ispunct.sh FAIL: test-c32isspace.sh FAIL: test-c32isupper.sh FAIL: test-c32isxdigit.sh FAIL: test-c32rtomb.sh FAIL: test-c32snrtombs-5.sh FAIL: test-c32srtombs-5.sh FAIL: test-c32stombs-5.sh FAIL: test-c32tolower.sh FAIL: test-c32toupper.sh FAIL: test-mbrtoc16-5.sh FAIL: test-mbrtoc32-5.sh FAIL: test-mbsnrtoc32s-5.sh FAIL: test-mbsrtoc32s-5.sh FAIL: test-mbstoc32s-5.sh Debugging the first one shows that when GL_CHAR32_T_IS_UNICODE (or, equivalently, GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION) is defined, the iconv() call in lc-charset-unicode.c may fail. For example, when the input is 0x94 0x32 0xBB 0x34, mbrtowc converts it to the wchar_t value 0x1432BB34, wcrtomb converts it back to 0x94 0x32 0xBB 0x34, and iconv() fails on this input (when it shouldn't). 2024-01-18 Bruno Haible <br...@clisp.org> Avoid test failures in FreeBSD's GB18030 locale. The FreeBSD 14.0 iconv converter (GB18030 → UTF-8) cannot convert e.g. 0x94 0x32 0xBB 0x34 to U+1D100. * tests/test-c32isalnum.c (main): Skip the GB18030 locale tests on FreeBSD, if GL_CHAR32_T_IS_UNICODE (or, equivalently, GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION) is defined. * tests/test-c32isalpha.c (main): Likewise. * tests/test-c32isblank.c (main): Likewise. * tests/test-c32iscntrl.c (main): Likewise. * tests/test-c32isdigit.c (main): Likewise. * tests/test-c32islower.c (main): Likewise. * tests/test-c32ispunct.c (main): Likewise. * tests/test-c32isspace.c (main): Likewise. * tests/test-c32isupper.c (main): Likewise. * tests/test-c32isxdigit.c (main): Likewise. * tests/test-c32rtomb.c (main): Likewise. * tests/test-c32snrtombs.c (main): Likewise. * tests/test-c32srtombs.c (main): Likewise. * tests/test-c32stombs.c (main): Likewise. * tests/test-c32tolower.c (main): Likewise. * tests/test-c32toupper.c (main): Likewise. * tests/test-mbrtoc16.c (main): Likewise. * tests/test-mbrtoc32.c (main): Likewise. * tests/test-mbsnrtoc32s.c (main): Likewise. * tests/test-mbsrtoc32s.c (main): Likewise. * tests/test-mbstoc32s.c (main): Likewise. diff --git a/tests/test-c32isalnum.c b/tests/test-c32isalnum.c index 111641c4d3..4f75e0f4aa 100644 --- a/tests/test-c32isalnum.c +++ b/tests/test-c32isalnum.c @@ -212,7 +212,7 @@ main (int argc, char *argv[]) case '4': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32isalpha.c b/tests/test-c32isalpha.c index e9f6684118..14c78d7d23 100644 --- a/tests/test-c32isalpha.c +++ b/tests/test-c32isalpha.c @@ -210,7 +210,7 @@ main (int argc, char *argv[]) case '4': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32isblank.c b/tests/test-c32isblank.c index 1b69272f45..0e722b2575 100644 --- a/tests/test-c32isblank.c +++ b/tests/test-c32isblank.c @@ -169,7 +169,7 @@ main (int argc, char *argv[]) case '4': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32iscntrl.c b/tests/test-c32iscntrl.c index 4e72de6a80..674c580412 100644 --- a/tests/test-c32iscntrl.c +++ b/tests/test-c32iscntrl.c @@ -171,7 +171,7 @@ main (int argc, char *argv[]) case '4': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32isdigit.c b/tests/test-c32isdigit.c index 30ab5d0f1a..82b77015f0 100644 --- a/tests/test-c32isdigit.c +++ b/tests/test-c32isdigit.c @@ -183,7 +183,7 @@ main (int argc, char *argv[]) case '4': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32islower.c b/tests/test-c32islower.c index 4e7311fe92..3b799677fb 100644 --- a/tests/test-c32islower.c +++ b/tests/test-c32islower.c @@ -267,7 +267,7 @@ main (int argc, char *argv[]) case '4': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32ispunct.c b/tests/test-c32ispunct.c index 5b2589cc81..1b9f8e3b3c 100644 --- a/tests/test-c32ispunct.c +++ b/tests/test-c32ispunct.c @@ -265,7 +265,7 @@ main (int argc, char *argv[]) case '4': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32isspace.c b/tests/test-c32isspace.c index e80f1527a6..15cf387dcf 100644 --- a/tests/test-c32isspace.c +++ b/tests/test-c32isspace.c @@ -165,7 +165,7 @@ main (int argc, char *argv[]) case '4': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32isupper.c b/tests/test-c32isupper.c index 0d9b229527..178b0d1998 100644 --- a/tests/test-c32isupper.c +++ b/tests/test-c32isupper.c @@ -259,7 +259,7 @@ main (int argc, char *argv[]) case '4': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32isxdigit.c b/tests/test-c32isxdigit.c index bd5dabb3bb..0c266f4705 100644 --- a/tests/test-c32isxdigit.c +++ b/tests/test-c32isxdigit.c @@ -200,7 +200,7 @@ main (int argc, char *argv[]) case '4': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32rtomb.c b/tests/test-c32rtomb.c index 73cecefc9a..c33d08d3d4 100644 --- a/tests/test-c32rtomb.c +++ b/tests/test-c32rtomb.c @@ -156,7 +156,7 @@ main (int argc, char *argv[]) case '5': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32snrtombs.c b/tests/test-c32snrtombs.c index 5781c4d231..3057af8b3d 100644 --- a/tests/test-c32snrtombs.c +++ b/tests/test-c32snrtombs.c @@ -160,7 +160,7 @@ main (int argc, char *argv[]) case '5': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32srtombs.c b/tests/test-c32srtombs.c index 037c50ccd1..416c96e3fb 100644 --- a/tests/test-c32srtombs.c +++ b/tests/test-c32srtombs.c @@ -160,7 +160,7 @@ main (int argc, char *argv[]) case '5': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32stombs.c b/tests/test-c32stombs.c index afdeca3862..b7cc13ca42 100644 --- a/tests/test-c32stombs.c +++ b/tests/test-c32stombs.c @@ -139,7 +139,7 @@ main (int argc, char *argv[]) case '5': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32tolower.c b/tests/test-c32tolower.c index e2cd18396d..681191b4ad 100644 --- a/tests/test-c32tolower.c +++ b/tests/test-c32tolower.c @@ -336,7 +336,7 @@ main (int argc, char *argv[]) case '4': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-c32toupper.c b/tests/test-c32toupper.c index 9660a2e843..ef57cd76ef 100644 --- a/tests/test-c32toupper.c +++ b/tests/test-c32toupper.c @@ -348,7 +348,7 @@ main (int argc, char *argv[]) case '4': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-mbrtoc16.c b/tests/test-mbrtoc16.c index 3f4430f14e..a356736ea9 100644 --- a/tests/test-mbrtoc16.c +++ b/tests/test-mbrtoc16.c @@ -361,7 +361,7 @@ main (int argc, char *argv[]) case '5': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-mbrtoc32.c b/tests/test-mbrtoc32.c index c83a12547e..6fffb2a71c 100644 --- a/tests/test-mbrtoc32.c +++ b/tests/test-mbrtoc32.c @@ -360,7 +360,7 @@ main (int argc, char *argv[]) case '5': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-mbsnrtoc32s.c b/tests/test-mbsnrtoc32s.c index 9e52f46b23..aa980bc4b5 100644 --- a/tests/test-mbsnrtoc32s.c +++ b/tests/test-mbsnrtoc32s.c @@ -315,7 +315,7 @@ main (int argc, char *argv[]) case '5': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-mbsrtoc32s.c b/tests/test-mbsrtoc32s.c index 89ed05ecca..fb6494a76d 100644 --- a/tests/test-mbsrtoc32s.c +++ b/tests/test-mbsrtoc32s.c @@ -315,7 +315,7 @@ main (int argc, char *argv[]) case '5': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif diff --git a/tests/test-mbstoc32s.c b/tests/test-mbstoc32s.c index 40f7894da2..297d707d41 100644 --- a/tests/test-mbstoc32s.c +++ b/tests/test-mbstoc32s.c @@ -263,7 +263,7 @@ main (int argc, char *argv[]) case '5': /* Locale encoding is GB18030. */ - #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)) + #if (defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 13 && __GLIBC_MINOR__ <= 15) || (GL_CHAR32_T_IS_UNICODE && (defined __FreeBSD__ || defined __NetBSD__ || defined __sun)) fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr); return 77; #endif