------- Comment #17 from rleigh at debian dot org  2006-06-16 16:59 -------
Created an attachment (id=11682)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11682&action=view)
Use mbsnrtowcs directly.

This testcase is similar to the original, with the exception that it uses
mbsnrtowcs in place of the codecvt locale facet.  It also initialises the
locale with setlocale() for LC_CTYPE.

It shows some interesting results, in fact the exact opposite of the original
testcase:

GCC ver     powerpc   i386
3.3         fail      fail
3.4         OK        OK
4.0         OK        fail
4.1         OK        fail
4.2         OK        fail

With this test, the expected output is this:
$ ./wide2
1
fffäß»
fffäß»

The output for the failed tests:

GCC 3.3:
powerpc (GCC 3.3 was bad at wide streams; the output is "lost"):
$ ./wide2
1
fffäß»

i386:
$ ./wide2
wide2: ../iconv/loop.c:425: utf8_internal_loop_single: Assertion `inptr -
bytebuf > (state->__count & 7)' failed.
Aborted

GCC 4.0/i386:
$ ./wide2
wide2: ../iconv/loop.c:425: utf8_internal_loop_single: Assertion `inptr -
bytebuf > (state->__count & 7)' failed.
Aborted

GCC 4.1/i386:
 ./wide2
wide2: ../iconv/loop.c:425: utf8_internal_loop_single: Assertion `inptr -
bytebuf > (state->__count & 7)' failed.
Aborted

GCC 4.2/i386:
$ ./wide2
wide2: ../iconv/loop.c:425: utf8_internal_loop_single: Assertion `inptr -
bytebuf > (state->__count & 7)' failed.
Aborted

Please do allow for the fact that one (or both) of these testcases might be
buggy; I've never used these interfaces before.  However... the behaviour is
still highly variable between the two platforms.


Regards,
Roger


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28059

Reply via email to