Bug 4764 - std::wstring missing on Solaris
Summary: std::wstring missing on Solaris
Status: RESOLVED DUPLICATE of bug 6702
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.4.0
: P3 enhancement
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2001-11-01 10:26 UTC by Martin v. Loewis
Modified: 2003-06-14 22:02 UTC (History)
2 users (show)

See Also:
Host: sparc-sun-solaris2.8
Target: sparc-sun-solaris2.8
Build: sparc-sun-solaris2.8
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin v. Loewis 2001-11-01 10:26:00 UTC
	On Solaris 8, std::wstring is not available, because libstdc++/aclocal.m4
        checks for too many functions

	The following functions are not available on Solaris. They are
        required to enable wide strings in libstdc++, but they aren't used
        by the implementation:

        vwscanf vfwscanf vswscanf wcstof

        Notice that support for these functions is only mandated by ISO C99,
        not by ISO C++.

Release:
3.0.2 20011014 (prerelease)

Environment:
System: SunOS paros 5.8 Generic_108528-08 sun4u sparc SUNW,Sun-Blade-1000
Architecture: sun4

host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../configure --enable-shared --enable-threads --with-cpu=v8 --with-gnu-ld --with-gnu-as --enable-version-specific-runtime-libs

How-To-Repeat:
	Try compiling

        #include <string>
        int main(){
          std::wstring s;
        }

        This gives

        a.cc:3: `wstring' undeclared in namespace `std'
Comment 1 Martin v. Loewis 2001-11-01 10:26:00 UTC
Fix:
        Separately check for these functions in aclocal.m4. If available,
        export them in include/c_std/bits/std_cwchar.h.

        In addition, Solaris 8 introducs a #define for wcsftime to
        __wcsftime_xpg5, and of wcstok to __wcstok_xpg5, unless
        _XOPEN_VERSION is 4 or #pragma redefine_extname is supported; so
        re-exporting those functions should happen carefully.

        Finally, std_cwctype.h re-exports iswblank, even though aclocal.m4
        didn't test for it, nor is it supported C99.
Comment 2 richard.mouli 2002-09-09 14:22:21 UTC
From: richard.mouli@axa.be
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, 
	loewis@informatik.hu-berlin.de, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, 
	phil@jaj.com
Cc:  
Subject: Re: libstdc++/4764: std::wstring missing on Solaris
Date: Mon, 9 Sep 2002 14:22:21 +0200 

 <http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view
 audit-trail&database=gcc&pr=4764>
 
 It seems to also aply to the platform i686-pc-cygwin (reported by
 gcc-3.2/config.guess).
 
 Please what is the current bug status?
 Thanks
 
 	Richard
Comment 3 Wolfgang Bangerth 2002-11-06 09:27:15 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: I can reproduce this with 3.0. With 3.2 I now get linker errors:
    
    atlas2/wolf> /data/user/software/sparc-sun-solaris2.7/gcc-3.2.0/bin/c++ x.cc
    Undefined                       first referenced
     symbol                             in file
    std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string[in-charge]()/var/tmp//ccxuKT4M.o
    std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::~basic_string [in-charge]()/var/tmp//ccxuKT4M.o
    ld: fatal: Symbol referencing errors. No output written to a.out
    collect2: ld returned 1 exit status
Comment 4 Benjamin Kosnik 2003-05-22 17:18:24 UTC
This is a known issue. It would be great to fix it for 3.4, but somebody with a
solaris box is going to have to take the lead.
Comment 5 Andrew Pinski 2003-06-14 22:02:47 UTC
Another dup of bug 6702 	hopefully someone will look at this soon.

*** This bug has been marked as a duplicate of 6702 ***