This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

PR 2989


Hi, 

can ANYONE compile this snippet of code with gcc 3 branch ?

#include <string.h>
#include <iostream>

using namespace std;

int main() {
  char foo[300];
  char* bar = "foo";

  strcpy(foo, bar);
}


For WEEKS gcc 3 is unusable for me as I can't compile ANY bit of code out 
there. Am I really the only one experiencing this problem ? 


The error message is: 

 call of overloaded `strcpy(char[300], char*&)' is ambiguous
/usr/include/string.h:78: candidates are: char* strcpy(char*, const char*)
/usr/local/include/g++-v3/bits/std_cstring.h:104:                 char* 
   std::strcpy(char*, const char*)


I'm using Linux x86/glibc 2.2.2, which shouldn`t be too uncommon. 


Dirk


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