Need locale help

François Dumont francois.cppdevs@free.fr
Mon Dec 6 20:49:00 GMT 2010


Hello

     In order to finally have all tests running on my distrib I have 
started working on locale tests that are failing on my side. I have 
started with a simple one 22_locale/messages/members/char/1.cc. I 
discovered that when run this test was looking for the catalog in '.' 
folder. So it means that it is looking for the catalog in current test 
folder so my first question is: what is the test execution folder ?

     I then try to modify the test to give it an absolute path to my 
test folder rather than '.'. I pass 
"/home/fdt/dev/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/testsuite", 
is it the place where the catalog should be taken ? At least I found a 
'de' and 'fr' folder in this folder with the LC_MESSAGES/libstdc++.mo 
files within it so I guessed it was the right place. However the test is 
looking for 'de_DE' locale but the folder is 'de' I wonder if it was an 
issue but creating a link de_DE folder didn't gave better result.

     So I start to look at code of the 'gnu' mode and was surprise to 
see that what is documented as 'complete and fully functional' is a 
little bit limited. When you open a catalog it always return 0 so if you 
want to play with 2 catalogs the second open will override the first one 
and you won't have the expected result. IMO we should use dgettext 
rather than gettext and keep a mapping within the lib to associate a 
'catalog' value to each domain. We could then get the domain back when 
we need it in do_get method to call dgettext. This is just an idea that 
I haven't study in detail for the moment.

     As I couldn't have the gnu mode to work I try the ieee_1003.1-2001 
mode. First, it do not build, it looks like no one try it for a long 
time. As far as I understand the doc the ieee mode is some kind of gnu 
mode with only usage of catopen/catgets instead of testdomain/gettext. 
However if you check the config/locale/ieee... folder you see that there 
is also c_locale.h/c_locale.c files that are incomplete to build the 
lib. In my opinion ieee mode should simply use the same files as the gnu 
modes except the messages_members.h/.cc files, no ? This is what I am 
trying so far but with no success. How can I tell the build system to 
use everything from gnu except messages files ? I try to edit configure 
script where I found definition of CLOCALE_H, CCODECVT_CC... to point to 
gnu files but it still tries to get things from ieee folder when I 
build. I don't know the automake/autoconf stuff but I know that the 
configure script is normally generated, what file should I edit to 
change this behavior ?

     Additionally I notice that messages_member.h/.cc files are not 
valid, especially on a 64 bits platform because it tries to cast a 
nl_catd to a catalog that is to say a void* to an int. This is why you 
will find attached a proposition of updated implementation based on an 
internal storage similar to what should be done on gnu side. I haven't 
been able to use mutex in the messages_members.cc files for the moment...

Thanks in advance for any help.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: messages_members.cc
Type: text/x-c
Size: 4216 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20101206/a02587a5/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: messages_members.h
Type: text/x-c
Size: 2211 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20101206/a02587a5/attachment-0001.bin>


More information about the Libstdc++ mailing list