stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Nesbitt (JIRA)" <>
Subject [jira] Created: (STDCXX-1035) Issue with string::find(const string& str, size_type pos=0)
Date Tue, 05 May 2009 11:11:30 GMT
Issue with string::find(const string& str, size_type pos=0)

                 Key: STDCXX-1035
             Project: C++ Standard Library
          Issue Type: Bug
          Components: 21. Strings
    Affects Versions: 4.2.1
         Environment: OS: Solaris 2.10
Compiler: Sun Studio 12
            Reporter: Brian Nesbitt

I recently encountered a problem with stdcxx demonstrated by the following example:

#include <string>

int main()
    std::string s = "";
    std::string s1 = "";

    std::string::size_type pos = s1.find(s);
    if (pos != std::string::npos)
        return 0;
        return 1;

The code above was compiled using the sun studio 12 compiler:
CC -library=%none -I/spare/include/stdcxx -L/spare/lib -lstd12d -mt -lpthread google.cpp

With the stdcxx 4.2.1 library, the return code is 1 indicating that find failed. However the
return code is 0 when using sun studio with the Cstd or STLPort4 libraries. Compiling with
g++ 4.1 on Linux also returns 0 indicating that find was successful.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message