This is the mail archive of the
mailing list for the GCC project.
Re: [v3] libstdc++/7811
Jakub Jelinek wrote:
I see, but I don't think we can afford the risk of crashes in a MT
environment only for this kind of QoI issue in the inizialization from
... as Roland McGrath explained to me privately setlocale(LC_ALL, "")
*cannot* be used in a MT environment.
For #ifndef _GLIBCPP_C_LOCALE_GNU you should do:
old = strdup(setlocale(LC_ALL, NULL));
ret = strdup(setlocale(LC_ALL, ""));
or some such, for _GLIBCPP_C_LOCALE_GNU maybe "" should be passed directly
to _Impl constructor...
That's true, but without uselocale you basically have no other option.
Even when you have some _l routines, lots of others are still missing.
On the other hand...
... this is an interesting, indeed, but much more complex and invasive
proposal. If you can work out a patch I think Benjamin would be happy to
review it! ;-)
So IMHO at least with glibc 2.3+ we should DTRT (provided that we allow
libstdc++-v3 to use __names members of struct __locale_struct), which
is pass "" as locale name down to _Impl down to _S_create_locale in that
case and if we really need accurate _M_names, set them
Benjamin, what do you believe?