Receiving warning: implicit function declaration: memset

We have the Sunstudio 11 compiler: Sun C 5.8 2005/10/13 and I created a C program and am receiving the above message:

include <stdio.h>

#include <stdlib.h>

/*

*

*/

int

main(int argc, char** argv)

{

char formatString[200];

memset(formatString, 0, sizeof(formatString));

if (argc != 2)

{

fprintf(stderr, "Usage: %s: argument\n", argv[0]);

return (1);

}

sprintf(formatString, "Hello %s, from old hello world program", argv[1]);

printf("%s\n", formatString);

return (EXIT_SUCCESS);

}

When I compile, I receive

"warning: implicit function declaration: memset". I also have code that uses strcpy and strcmp and I receive:

warning: implicit function declaration: strcpy

warning: implicit function declaration: strcmp

When I compile with Workshp 6.2, this warning does not occur. This problem is a prototype issue. In Workshop 6.2, this was resolved if the string.h was not included. The compiler searched until it found the correct header. Is there a way to get the compiler to do what Workshop did?

[1170 byte] By [DennisRussell] at [2007-11-26 9:15:27]
# 1
Not sure I understand what was the "prototype issue" with 6.2 copiler? memset() is defined in <string.h>, so all you need is to #include this header and both versions of C compiler do not generate any warnings afer that.
MaximKartashev at 2007-7-6 23:40:28 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

Thanks, I was just wondering why in 6.1 it was resolved. By including the appropriate header, the problem goes away. With the stub, I wrote, the program compiled on 6.1 with no warnings. But with studio, it compiled with the warning. This was a little bit strange. The developer really should include the appropriate header.

DennisRussell at 2007-7-6 23:40:28 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
The old C compiler used 1990 C rules. Those rules allowed implicit function calls.The new C compiler uses 1999 C rules by default. In C99, you must have a function progotype in scope, so the compiler issues a warning.
clamage45 at 2007-7-6 23:40:28 > top of Java-index,Development Tools,Solaris and Linux Development Tools...