mirror of
https://github.com/frida/tinycc
synced 2025-01-23 03:32:03 +03:00
Deal with more tentative definitions
see testcase.
This commit is contained in:
parent
69a46b0c53
commit
fe23a14ebb
1
tccgen.c
1
tccgen.c
@ -1005,6 +1005,7 @@ static Sym *external_sym(int v, CType *type, int r, AttributeDef *ad)
|
||||
Sym *s;
|
||||
s = sym_find(v);
|
||||
if (!s || (!IS_ASM_SYM(s) && !(s->type.t & VT_EXTERN)
|
||||
&& (!(type->t & VT_EXTERN) || s->sym_scope)
|
||||
&& (s->type.t & VT_BTYPE) != VT_FUNC)) {
|
||||
if (s && !is_compatible_types(&s->type, type))
|
||||
tcc_error("conflicting types for '%s'", get_tok_str(s->v, NULL));
|
||||
|
@ -816,6 +816,16 @@ void scope_test2()
|
||||
printf("exloc: %d\n", *st2_p);
|
||||
}
|
||||
|
||||
/* C has tentative definition, and they may be repeated. */
|
||||
extern int st_global1;
|
||||
int st_global1=42;
|
||||
extern int st_global1;
|
||||
int st_global1;
|
||||
extern int st_global2;
|
||||
int st_global2;
|
||||
extern int st_global2;
|
||||
int st_global2;
|
||||
|
||||
void array_test()
|
||||
{
|
||||
int i, j, a[4];
|
||||
|
Loading…
Reference in New Issue
Block a user