Compiling the below code in gcc (gcc -Wall foo.c) yields the following warning message:
foo.c: In function 'main':
foo.c:9: warning: implicit declaration of function 'strlen'
foo.c:9: warning: incompatible implicit declaration of built-in function 'strlen'
When I compile using Intel C++ compiler (icpc -Wall foo.c) I get the below error message:
foo.c(9): error: identifier "strlen" is undefined
len = strlen(foo);
When I compile using Intel C compiler (icc -Wall foo.c) no warning messages are displayed. Why is this the case?
#include <stdlib.h>
int main (int argc, char **argv)
{
char foo[] = "abcd";
int len;
len = strlen(foo);
return 0;
}