A T <[EMAIL PROTECTED]> writes:
> I downloaded the stl headers from rpmfind.net and
> found a problem with it. The package name is:
> hacklibstdc++-2.96-0.6mdk.i586.rpm and the problem was
> in the <string> header. How ever did the
> implementation, went ahead and commented out the
> wstring definition. If you uncomment that line,
> wstring will work as long as you are not calling
> c_str() on it. The reason is that c_str() was
> implemented with the following line:
> return "". This means it will return a single wide
> char when it really shoud return a wchar_t. However,
> since the template is used for char and wchar_t, a
> problem will be facing you to choose between return ""
> or return L"".
> Two ways to solve this. One to define an empty string
> inside the implementation file
> (/usr/include/g++-3/std/bastring.h) and it has to be
> defined as char or wchar_t depending on the
> instantiation.
> The second solution (which I did) is to derive a class
> from basic_string (I called the derived class
> basic_wstring) and all I did is overridden the c_str()
> function in basic_string. Then, in
> /usr/include/g++-3/string, I modified the typedef
> basic_string <wchar_t> wstring (which was commented
> out) to typedef basic_wstring <wchar_t> wstring.
> Everything started working out after that. I wonder
> who will be taking care of this bug and when and where
> would I get the new package?
i'll do, you may look if it was not already reported on the gcc
mailing list since the hacklibstdc++ is a cvs version of the gcc
snapshot.
--
MandrakeSoft Inc http://www.chmouel.org
Paris, France --Chmouel