This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
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 the environment.... 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, "")); setlocale(LC_ALL, old); free(old); 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.
... 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 from __cloc->__names[x].
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |