What is meant by the term "implicit declaration of a function". Call to standard library function without including the appropriate header file produces a warning as in case of
printf("How is this not an error ?");
It should be considered an error. But C is an ancient language, so it's only a warning.
-Werror (gcc) fixes this problem.
When C doesn't find a declaration, it assumes this implicit declaration:
int f();, which means the function can receive whatever you give it, and returns an integer. If this happens to be close enough (and in case of
printf, it is), then things can work. In some cases (e.g. the function actually returns a pointer, and pointers are larger than ints), it may cause real trouble.
Note that this was fixed in newer C standards (C99, C11). In these standards, this is an error. However,
gcc doesn't implement these standards by default, so you still get the warning.