[PATCH, RFC] Codecvt and _M_c_locale_codecvt
Paolo Carlini
pcarlini@unitus.it
Mon Sep 9 19:49:00 GMT 2002
Benjamin Kosnik wrote:
>>as noticed by Jakub a few days ago, a wcsrtombs and a mbsrtowcs call
>>in src/codecvt.cc are still not wrapped in __uselocale.
>>
>>In order to fix this, it seems to me that a _M_c_locale_codecvt member
>>must be added to the codecvt specializations.
>>
>>Is this unavoidable? Then, most probably the patch may qualify only for 3.3.
>>
>>
>If all you need is the "C" locale, you could just use _S_c_locale.
>In your current patch, for instance, only the "C" locale is used. Is
>this intentional?
>
>If you need to use more than the "C" locale, then the member
>_M_c_locale_codecvt will be necessary. Also, ctor for codecvt that
>accepts this argument. Also, tweaks to src/localename.cc initialization
>so that the _Impl ctor for named locales passes it down.
>
>As you probably noticed, your patch, even though it adds a data member,
>supposedly doesn't change the library ABI. This seems to be because
>codecvt isn't instantiated, only specialized. Because of this, and the
>fact that there are no embedded cvt facets, only references, and the
>includes are versioned, I'd think this would be ok.
>
>>I'm also unsure if the _M_c_locale_codecvt member is really necessary also
>>for the codecvt<_InternT, _ExternT, __enc_traits> specialization: it seems
>>so, however, due to the structure of codecvt_byname.
>>
>>
>This kind of member data is in other generic locale facets, so it would
>probably be good to add them as well to the generic codecvt.
>
Thanks Benjamin for your review: as often happens I learned from it many things
about the general structure of the library, well beyond the issues at hand.
I will do the changes and resubmit soon.
Ciao, Paolo.
More information about the Libstdc++
mailing list