diff --git a/libtcc.c b/libtcc.c
index f07699ba..94f43242 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -1045,6 +1045,7 @@ LIBTCCAPI TCCState *tcc_new(void)
                                       ".dynhashtab", SHF_PRIVATE);
     s->alacarte_link = 1;
     s->nocommon = 1;
+    s->warn_implicit_function_declaration = 1;
 
 #ifdef CHAR_IS_UNSIGNED
     s->char_is_unsigned = 1;
diff --git a/tests/tests2/46_grep.c b/tests/tests2/46_grep.c
index 3123bc39..049dfb15 100644
--- a/tests/tests2/46_grep.c
+++ b/tests/tests2/46_grep.c
@@ -16,6 +16,7 @@
  */
 #include <stdio.h>
 #include <stdlib.h>
+#include <ctype.h>	// tolower()
 
 /*
  * grep
diff --git a/tests/tests2/64_macro_nesting.c b/tests/tests2/64_macro_nesting.c
index 44b582fe..676e5d3e 100644
--- a/tests/tests2/64_macro_nesting.c
+++ b/tests/tests2/64_macro_nesting.c
@@ -1,3 +1,5 @@
+#include <stdio.h>	// printf()
+
 #define CAT2(a,b) a##b
 #define CAT(a,b) CAT2(a,b)
 #define AB(x) CAT(x,y)
diff --git a/win32/examples/fib.c b/win32/examples/fib.c
index 7c4ee24e..8da26bce 100644
--- a/win32/examples/fib.c
+++ b/win32/examples/fib.c
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>	// atoi()
 
 int fib(n)
 {