libstdc++-v3: Recent locale/ctype changes break NetBSD

Jason R Thorpe thorpej@wasabisystems.com
Mon Jan 21 21:47:00 GMT 2002


Hi Benjamin...

Some recent changes to locale_facets.h and ctype_noninline.h have
broken compilation of libstdc++-v3 on NetBSD.

In particular, with the most recent source from CVS, I get the following
when building src/locale.cc (sorry about the long lines -- I am just
pasting this directly):

/u2/hack/gnu-toolchain/gcc/build/alpha/gcc/xgcc -B/u2/hack/gnu-toolchain/gcc/bui
ld/alpha/gcc/ -nostdinc++ -L/u2/hack/gnu-toolchain/gcc/build/alpha/alpha-unknown
-netbsd/libstdc++-v3/src -L/u2/hack/gnu-toolchain/gcc/build/alpha/alpha-unknown-
netbsd/libstdc++-v3/src/.libs -B/usr/local/gnu/alpha-unknown-netbsd/bin/ -B/usr/
local/gnu/alpha-unknown-netbsd/lib/ -isystem /usr/local/gnu/alpha-unknown-netbsd
/include -nostdinc++ -I/u2/hack/gnu-toolchain/gcc/build/alpha/alpha-unknown-netb
sd/libstdc++-v3/include/alpha-unknown-netbsd -I/u2/hack/gnu-toolchain/gcc/build/
alpha/alpha-unknown-netbsd/libstdc++-v3/include -I../../../../../gcc/libstdc++-v
3/libsupc++ -I../../../../../gcc/libstdc++-v3/libmath -fno-implicit-templates -W
all -Wno-format -W -Wwrite-strings -Winline -fdiagnostics-show-location=once -ff
unction-sections -fdata-sections -g -c ../../../../../gcc/libstdc++-v3/src/local
e.cc -o locale.o
In file included from ../../../../../gcc/libstdc++-v3/src/locale.cc:398:
/u2/hack/gnu-toolchain/gcc/build/alpha/alpha-unknown-netbsd/libstdc++-v3/include
/bits/locale_facets.h: In
   constructor `std::ctype<char>::ctype(const unsigned char*, bool, long
   unsigned int)':
/u2/hack/gnu-toolchain/gcc/build/alpha/alpha-unknown-netbsd/libstdc++-v3/include
/bits/locale_facets.h:235: warning: member
   initializers for `const unsigned char*std::ctype<char>::_M_tolower'
/u2/hack/gnu-toolchain/gcc/build/alpha/alpha-unknown-netbsd/libstdc++-v3/include
/bits/locale_facets.h:234: warning:
    and `const unsigned char*std::ctype<char>::_M_toupper'
/u2/hack/gnu-toolchain/gcc/build/alpha/alpha-unknown-netbsd/libstdc++-v3/include
/alpha-unknown-netbsd/bits/ctype_noninline.h:50: warning:
    will be re-ordered to match declaration order
/u2/hack/gnu-toolchain/gcc/build/alpha/alpha-unknown-netbsd/libstdc++-v3/include
/alpha-unknown-netbsd/bits/ctype_noninline.h:50: multiple
   initializations given for member `std::ctype<char>::_M_toupper'
/u2/hack/gnu-toolchain/gcc/build/alpha/alpha-unknown-netbsd/libstdc++-v3/include
/alpha-unknown-netbsd/bits/ctype_noninline.h:50: multiple
   initializations given for member `std::ctype<char>::_M_tolower'
gmake[2]: *** [locale.lo] Error 1
gmake[2]: Leaving directory `/u2/hack/gnu-toolchain/gcc/build/alpha/alpha-unknow
n-netbsd/libstdc++-v3/src'

If I back out the following two changes:

2002-01-20  Benjamin Kosnik  <bkoz@redhat.com>

        * include/bits/locale_facets.h (ctype<char>::classic_table):
        Remove definition.
        (ctype<char>::_S_ctable): Remove.
        * config/os/gnu-linux/bits/ctype_noninline.h
        (ctype<char>::_S_table): Remove definition.
        (ctype<char>::classic_table): Define. 
        (ctype<char>::ctype): Replace _S_ctable with classic_table().
        * config/os/aix/bits/ctype_noninline.h: Same.
        * config/os/bsd/freebsd/bits/ctype_noninline.h: Same.
        * config/os/bsd/netbsd/bits/ctype_noninline.h: Same.
        .
        .
        .

...and:

2002-01-16  Benjamin Kosnik  <bkoz@redhat.com>

        * include/bits/locale_facets.h (ctype<char>::classic_table): Make
        static.
        (ctype<char>::_M_ctable): Make static, change name to _S_ctable.
        * config/os/gnu-linux/bits/ctype_noninline.h: Define _S_ctable.
        * config/os/solaris/solaris2.7/bits/ctype_noninline.h: Same.
        * config/os/solaris/solaris2.6/bits/ctype_noninline.h: Same.
        * config/os/solaris/solaris2.5/bits/ctype_noninline.h: Same.
        * config/os/newlib/bits/ctype_noninline.h: Same.
        * config/os/irix/irix6.5/bits/ctype_noninline.h: Same.
        * config/os/irix/irix5.2/bits/ctype_noninline.h: Same.
        * config/os/hpux/bits/ctype_noninline.h: Same.
        * config/os/djgpp/bits/ctype_noninline.h: Same.
        * config/os/bsd/netbsd/bits/ctype_noninline.h: Same.
        .
        .
        .

...then it builds okay again.

Please make sure CC me on your reply, as I am not a member of the
libstdc++ mailing list.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>



More information about the Libstdc++ mailing list