diff options
| author | seyko <seyko2@gmail.com> | 2015-03-03 16:32:25 +0300 |
|---|---|---|
| committer | seyko <seyko2@gmail.com> | 2015-03-03 16:32:25 +0300 |
| commit | b5f88b593a580956dfb74b6fb9ba9ab3e178bdf6 (patch) | |
| tree | 0706ed18dd84cee1a712c6ef2cea174c514e5e34 | |
| parent | 7f36abd3f21fe0736bfe062f618e4fd1993bf806 (diff) | |
| download | tinycc-b5f88b593a580956dfb74b6fb9ba9ab3e178bdf6.tar.gz tinycc-b5f88b593a580956dfb74b6fb9ba9ab3e178bdf6.tar.bz2 | |
Turn on a implicit-function-declaration warning by default.
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.
| -rw-r--r-- | libtcc.c | 1 | ||||
| -rw-r--r-- | tests/tests2/46_grep.c | 1 | ||||
| -rw-r--r-- | tests/tests2/64_macro_nesting.c | 2 | ||||
| -rw-r--r-- | win32/examples/fib.c | 1 |
4 files changed, 5 insertions, 0 deletions
@@ -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 3123bc3..049dfb1 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 44b582f..676e5d3 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 7c4ee24..8da26bc 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) { |
