This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]