allow redefinition of func_old_type functions
void *memcpy(void*, const void*, unsigned); This gave an error if memcpy() has been used before implicitely, e.g. for structure passing etc.
This commit is contained in:
parent
c3701df16c
commit
6a004ed19f
1 changed files with 7 additions and 4 deletions
11
tccgen.c
11
tccgen.c
|
@ -115,10 +115,13 @@ static Sym *external_sym(int v, CType *type, int r)
|
||||||
/* push forward reference */
|
/* push forward reference */
|
||||||
s = sym_push(v, type, r | VT_CONST | VT_SYM, 0);
|
s = sym_push(v, type, r | VT_CONST | VT_SYM, 0);
|
||||||
s->type.t |= VT_EXTERN;
|
s->type.t |= VT_EXTERN;
|
||||||
} else {
|
} else if (s->type.ref == func_old_type.ref) {
|
||||||
if (!is_compatible_types(&s->type, type))
|
s->type.ref = type->ref;
|
||||||
error("incompatible types for redefinition of '%s'",
|
s->r = r | VT_CONST | VT_SYM;
|
||||||
get_tok_str(v, NULL));
|
s->type.t |= VT_EXTERN;
|
||||||
|
} else if (!is_compatible_types(&s->type, type)) {
|
||||||
|
error("incompatible types for redefinition of '%s'",
|
||||||
|
get_tok_str(v, NULL));
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue