http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59717
Bug ID: 59717 Summary: better warning when using functions when including appropriate header files Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: metherid at gmail dot com Clang produces a better warning suggesting the appropriate header file compared to GCC. Test program included $gcc testwarning.c testwarning.c: In function ‘main’: testwarning.c:4:2: warning: incompatible implicit declaration of built-in function ‘strcpy’ [enabled by default] strcpy(teststr, "foo"); ^ rahul@mether ~/work> clang test testfor testfor.c testwarning.c rahul@mether ~/work> clang testwarning.c testwarning.c:4:2: warning: implicitly declaring library function 'strcpy' with type 'char *(char *, const char *)' strcpy(teststr, "foo"); ^ testwarning.c:4:2: note: please include the header <string.h> or explicitly provide a declaration for 'strcpy' --- cat testwarning.c int main (void) { char *teststr; strcpy(teststr, "foo"); ---