This is my code(simplified):
#include <stdio.h>
#include <string.h>
#define SIZE 240
int main(void)
{
char word[SIZE];
gets(word);
return 0;
}
Why GCC is giving me
№3.c: In function ‘main’:
№3.c:13:2: warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration]
this warning?
GCC vesion is 5.2.1
P.S.The program is working.
P.P.S. I will never use gets(), I will never use gets(), I will never use gets(), I will never use gets()
Function
gets
is not supported by the C Standard any more because it is an unsafe function. So it seems the function declaration was excluded from the header<stdio.h>
and now the compiler does not know what is the declaration of thegets
.From the C Standard (Foreword)
...