[PATCH] Fix ctype<char> for generic locale systems on linux

Paolo Carlini pcarlini@unitus.it
Sat Jan 19 12:46:00 GMT 2002


Hi Benjamin, hi all,

in the last hours I have tried what you suggested: either I did'nt understand it
fully or because of some trickiness with the inizialization of static variables,
in short I could not really implement it.

However, I cooked up this one-liner (inspired from the previous code) which on
my i686-pc-linux-gnu both passes make check and the testcase distillated from
libstdc++/5424 runs smoothly.

A few questions: first, of course, is it a sensible fix? Second: in case the
patch is ok, could you please help in preparing the testsuite patch? Finally:
are there any other systems in need of this?

Cheers,
Paolo.

////////////

2002-01-19  Paolo Carlini <pcarlini@unitus.it>

        * config/os/gnu-linux/bits/ctype_noninline.h
        (ctype<char>::ctype(__c_locale, __table, __del, __refs)):
        Fix _M_table initialization.

--- ctype_noninline.h.orig Sat Jan 19 20:32:58 2002
+++ ctype_noninline.h Sat Jan 19 20:34:08 2002
@@ -58,7 +58,7 @@
        size_t __refs)
   : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
   _M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
-  _M_table(__table ? __table : _S_ctable)
+  _M_table(__table ? __table : __ctype_b)
   { _M_c_locale_ctype = NULL; }
 #endif




More information about the Libstdc++ mailing list