#include <iostream>
#include <string.h>
char* basename(const char* filname);
int main()
{
return 0;
}
char *basename(const char* filename)
{
char* base = (char *)filename;
return base ;
}
compilation on g ++ 4.1.2 20070115 (SUSE 10): No problem
compiling on g ++ 4.3.4 (SUSE 11) gives the following error
filename: 9: error: declaration char * basename (const char *) throws a different exception
fileName: 3: error: from previous declaration char * basename (const char *) throw ().
Tell me why this is happening. Is there any interface changed in g ++ between these two versions (if I remove the inclusion of string.h, then compilation success on both versions of g ++, is there any change in the interface in string.h).
source
share