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.
This commit is contained in:
parent
7f36abd3f2
commit
b5f88b593a
4 changed files with 5 additions and 0 deletions
1
libtcc.c
1
libtcc.c
|
@ -1045,6 +1045,7 @@ LIBTCCAPI TCCState *tcc_new(void)
|
||||||
".dynhashtab", SHF_PRIVATE);
|
".dynhashtab", SHF_PRIVATE);
|
||||||
s->alacarte_link = 1;
|
s->alacarte_link = 1;
|
||||||
s->nocommon = 1;
|
s->nocommon = 1;
|
||||||
|
s->warn_implicit_function_declaration = 1;
|
||||||
|
|
||||||
#ifdef CHAR_IS_UNSIGNED
|
#ifdef CHAR_IS_UNSIGNED
|
||||||
s->char_is_unsigned = 1;
|
s->char_is_unsigned = 1;
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <ctype.h> // tolower()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* grep
|
* grep
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#include <stdio.h> // printf()
|
||||||
|
|
||||||
#define CAT2(a,b) a##b
|
#define CAT2(a,b) a##b
|
||||||
#define CAT(a,b) CAT2(a,b)
|
#define CAT(a,b) CAT2(a,b)
|
||||||
#define AB(x) CAT(x,y)
|
#define AB(x) CAT(x,y)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h> // atoi()
|
||||||
|
|
||||||
int fib(n)
|
int fib(n)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue