[v3] libstdc++/7811

Paolo Carlini pcarlini@unitus.it
Fri Sep 6 15:35:00 GMT 2002


Jakub Jelinek wrote:

>Yes, for more recent glibcs it should include all 12
>categories
>
Ok.

>and use glibc composite format LC_CTYPE=foo;LC_NUMERIC=bar;...
>On Solaris, AFAIK the composite format is like:
>/ctype_locale_name/numeric_locale_name/C/C/C/C
>so the code has to be os specific.
>
I see, still conceptually simple but some additional complexity, in 
practice... 

>one problem I see is that
>locale::_Impl::_Impl(const char* __s, size_t __refs)
>doesn't make a copy of __s string when putting it into _M_names array,
>which looks like a bug to me - it can point to stale data RSN, and e.g. in
>the case where we are constructing _Impl(getenv("LC_ALL")) it is enough to
>change environment.
>
This seems easy to fix, however.

>Also, I wonder whether the individual _M_names in case _Impl was
>passed a composite name shouldn't be the LC_CTYPE/LC_NUMERIC etc. locales,
>not the composite name.
>
In private mail with Benjamin I hinted at this myself too, specifically 
in the form of some modifications needed for localename.cc, lines 
124-126. (while I'm writing this I see that Roland agrees)

Ciao, Paolo.



More information about the Gcc-patches mailing list