Small problem in testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-[1-4].cc

Pétur Runólfsson peturr02@ru.is
Tue Jul 1 19:54:00 GMT 2003


Hi Paolo,

There is a small problem in the test cases for PR 11305. After this change:

-  wint_t n1 = fb.sputc(0x20000000);
-  wint_t n2 = fb.sputc(0x40000000);
+  wfilebuf::int_type n1 = fb.sputc(L'i');
+  wfilebuf::int_type n2 = fb.sputc(L'a');

the test cases will no longer detect the presence of the bug.

The problem was that overflow failed to convert characters whose UTF-8
representation is larger than sizeof(wchar_t); 0x20000000 and 0x40000000
are two such characters (6 bytes each) but L'i' and L'a' only require a
single byte each ('i' and 'a').

Regards,
Petur



More information about the Libstdc++ mailing list