This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13084] New: class string with find(const char* cstr, size_type idx) member have different gcc 2.95 and gcc 3.3 behaviour
- From: "ronald dot van dot uden at rabobank dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Nov 2003 10:13:49 -0000
- Subject: [Bug c++/13084] New: class string with find(const char* cstr, size_type idx) member have different gcc 2.95 and gcc 3.3 behaviour
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
problem:
char* charPointerString = input;
while ((iPos = myStr.find(charPointerString, iPos)) != string::npos){}//an
infinite loop
workaround:
string myString(input);
while ((iPos = myStr.find(myString, iPos)) != string::npos){}//
gcc 2.95 and gcc 3.3 implementation difference of class string with find()
members
the string function
size_type string::find (const char* cstr, size_type idx) const
never finds the string it is looking for in gcc33 when cstr==""
the string function
size_type string::find(const string& str, size_type idx) const
works properly on gcc33 when str==""
______________________________________________________
the function find (const char* cstr, size_type idx) seems to work fine on
gcc2.95
Operating System: Sun Solaris9
--
Summary: class string with find(const char* cstr, size_type idx)
member have different gcc 2.95 and gcc 3.3 behaviour
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ronald dot van dot uden at rabobank dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13084