On 02/24/2018 12:02 PM, Bruno Haible wrote:
On Alpine Linux 3.7.0, which uses musl libc, this test fails:

FAIL: test-mbrtowc5.sh
======================

../../gltests/test-mbrtowc.c:106: assertion 'wc == c' failed
Aborted
FAIL test-mbrtowc5.sh (exit status: 134)

The issue is that in the C locale, musl uses the encoding that maps
   0x00..0x7F -> U+0000..U+007F
   0x80..0xFF -> U+DF80..U+DFFF

Whereas for older platforms it was natural to use the ISO-8859-1 encoding:
   0x00..0x7F -> U+0000..U+007F
   0x80..0xFF -> U+0080..U+00FF

This patch fixes the test.

Now this test fails on GNU/Linux - at least here on openSUSE-Tumbleweed.

FAIL: test-mbrtowc5.sh
======================

test-mbrtowc.c:114: assertion 'wc == btowc (c)' failed
./test-mbrtowc5.sh: line 4: 21847 Aborted                 (core dumped) 
LC_ALL=C ./test-mbrtowc${EXEEXT} 5
FAIL test-mbrtowc5.sh (exit status: 134)


(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff7a546b1 in __GI_abort () at abort.c:79
#2  0x0000000000400a7d in main (argc=<optimized out>, argv=<optimized out>) at 
test-mbrtowc.c:58
gdb) p wc
$2 = 128 L'\200'

Do you see the same?

Have a nice day,
Berny

Reply via email to