Issue Details (XML | Word | Printable)

Key: STDCXX-342
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Martin Sebor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

[Solaris] std::locale("/path/to/valid/locale") throws

Created: 27/Feb/07 07:20 PM   Updated: 15/May/08 08:16 PM
Return to search
Component/s: 22. Localization
Affects Version/s: 4.1.2, 4.1.3, 4.1.4, 4.2.0, 4.2.1
Fix Version/s: 4.2.2

Time Tracking:
Original Estimate: 4h
Original Estimate - 4h
Remaining Estimate: 4h
Remaining Estimate - 4h
Time Spent: Not Specified
Remaining Estimate - 4h

Environment: Solaris
Issue Links:
Reference
 

Severity: Runtime Error


 Description  « Hide
The locale ctors that take a locale name can't deal with absolute pathnames on Solaris (see the test case below). That's because the Solaris locale category separator is the same as a path separator (i.e., the forward slash character) and the ctors do not distinguish one from the other.

$ cat t.cpp && make t && LC_ALL=../nls/en_US.ISO-8859-1 ../bin/locale && ./t `cd ../nls && pwd`/en_US.ISO-8859-1
#include <locale>

int main (int, char *argv[])
{
(void)std::locale (argv [1]);
}
gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/examples/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long t.cpp
gcc t.o -o t -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s -lsupc++ -lm
LANG=C
LC_CTYPE="../nls/en_US.ISO-8859-1"
LC_COLLATE="../nls/en_US.ISO-8859-1"
LC_TIME="../nls/en_US.ISO-8859-1"
LC_MONETARY="../nls/en_US.ISO-8859-1"
LC_NUMERIC="../nls/en_US.ISO-8859-1"
LC_MESSAGES="../nls/en_US.ISO-8859-1"
LC_ALL=../nls/en_US.ISO-8859-1
terminate called after throwing an instance of 'std::runtime_error'
what(): /build/sebor/dev/stdlib/src/locale_combine.cpp:639: std::locale::locale(const char*): bad locale name: "/build/sebor/gcc-4.1.0-11s/nls/en_US.ISO-8859-1"
Abort (core dumped)



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.