| Summary: | std::locale("") not working in glibc 2.3.3 | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Bryan Forbes <bryan> |
| Component: | [OLD] Development | Assignee: | Please assign to toolchain <gcc-porting> |
| Status: | RESOLVED FIXED | ||
| Severity: | major | ||
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
test case
C test case |
||
Created attachment 31487 [details]
test case
exception thrown:
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
Aborted
This seems to be a glibc bug with locales. I'm attaching a test case that sets the locale in C and works, but the the c++ example attached earlier doesn't work. I also have filed a bug over at glibc's bugzilla: http://sources.redhat.com/bugzilla/show_bug.cgi?id=165 Created attachment 31612 [details]
C test case
gcc is broken, not glibc. the latest ebuilds should be fixed... re-open this bug if the problem still exists in gcc 3.4.0-r5 |
I'm attaching a test case that does not work in gcc 3.4. std::locale("") should use the locale in LC_ALL, but when you set LC_ALL to anything but "C" or "POSIX", this example will throw an exception. std::locale() should take all locale's supported by setlocale().