Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.1.4, 4.2.0, 4.2.1
-
None
-
All
-
Regression
-
Incorrect Behavior
Description
I recently encountered a problem with stdcxx demonstrated by the following example:
#include <string> int main() { std::string s = ".google.com"; std::string s1 = "www.google.google.com"; std::string::size_type pos = s1.find(s); if (pos != std::string::npos) { return 0; } else { 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.
Attachments
Issue Links
- is related to
-
STDCXX-176 std::string::find() inefficient
- Resolved