A non declared function leads to a seriuos problems. And while gcc don't turn this warning on lets tcc do it. This warning can be turned off by -Wno-implicit-function-declaration option. And autor must explicitly do this if program must be compiled with this warning off.
Unified · Split
| @@ -1045,6 +1045,7 @@ LIBTCCAPI TCCState *tcc_new(void) · 1044 unmodified lines | |||
| 1045 | ".dynhashtab", SHF_PRIVATE); | 1045 | ".dynhashtab", SHF_PRIVATE); |
| 1046 | s->alacarte_link = 1; | 1046 | s->alacarte_link = 1; |
| 1047 | s->nocommon = 1; | 1047 | s->nocommon = 1; |
| 1048 | s->warn_implicit_function_declaration = 1; | ||
| 1048 | 1049 | ||
| 1049 | #ifdef CHAR_IS_UNSIGNED | 1050 | #ifdef CHAR_IS_UNSIGNED |
| 1050 | s->char_is_unsigned = 1; | 1051 | s->char_is_unsigned = 1; |
| @@ -16,6 +16,7 @@ · 15 unmodified lines | |||
| 16 | */ | 16 | */ |
| 17 | #include <stdio.h> | 17 | #include <stdio.h> |
| 18 | #include <stdlib.h> | 18 | #include <stdlib.h> |
| 19 | #include <ctype.h> // tolower() | ||
| 19 | 20 | ||
| 20 | /* | 21 | /* |
| 21 | * grep | 22 | * grep |
| @@ -1,3 +1,5 @@ | |||
| 1 | #include <stdio.h> // printf() | ||
| 2 | |||
| 1 | #define CAT2(a,b) a##b | 3 | #define CAT2(a,b) a##b |
| 2 | #define CAT(a,b) CAT2(a,b) | 4 | #define CAT(a,b) CAT2(a,b) |
| 3 | #define AB(x) CAT(x,y) | 5 | #define AB(x) CAT(x,y) |
| @@ -1,4 +1,5 @@ | |||
| 1 | #include <stdio.h> | 1 | #include <stdio.h> |
| 2 | #include <stdlib.h> // atoi() | ||
| 2 | 3 | ||
| 3 | int fib(n) | 4 | int fib(n) |
| 4 | { | 5 | { |