This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc4.1.2 and 4.3.2 has different default behavior
- From: Yixuan Huang <yixuan178 at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 9 Mar 2011 12:53:56 +0800
- Subject: gcc4.1.2 and 4.3.2 has different default behavior
Hello All,
I have encountered one issue when write a simple test code.
#inlcude <iostream>
int main{
const char* str = "aaaa";
std::cout<<"str len: "<<strlen(str)<<std::endl;
return 0;
}
If I compile on gcc version 4.1.2 20070115 (SUSE Linux), it can be
compiled successfully. Otherwise, on gcc version 4.3.2 [gcc-4_3-branch
revision 141291] (SUSE Linux), it will show
linux-lht2:/home/yixuan # g++ aa.cpp
aa.cpp: In function âint main()â:
aa.cpp:6: error: âstrlenâ was not declared in this scope
I don't know where can I get the information to explain the different behavior?
Thanks,
yixuan