[Patch] Codecvt::do_length rewrite

Paolo Carlini pcarlini@suse.de
Tue Nov 25 16:49:00 GMT 2003


Hi,

this is the final part of the work, do_length... turned out to be
sligthly more difficult than expected, since mbsnrtowcs ignores
its fourth parameter if the first is NULL. Therefore, the best I
could do is adding a temporary dummy buffer. Interestingly, there
is *no* runtime penalty for this! Even more interesting and
unexpected, couldn't do a fare comparison with iconv, since,
_contrary to the official glibc docs_, passing a fourth NULL
parameter doesn't work and leads to seg faults or asserts. Weird.

Took to occasion to refine and uniformize here and there the existing
code for do_in and do_out. In the process I have discovered some
subtleties not completely covered by the current testsuite entries
and therefore mean to add a couple of new tests asap.

Tested x86-linux, will commit soon...

Paolo.

////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_do_length
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20031125/d22190c1/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_do_length
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20031125/d22190c1/attachment-0001.ksh>


More information about the Libstdc++ mailing list