diff options
Diffstat (limited to 'tccgen.c')
| -rw-r--r-- | tccgen.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -166,11 +166,13 @@ ST_INLN void sym_free(Sym *sym) ST_FUNC Sym *sym_push2(Sym **ps, int v, int t, long c) { Sym *s; - if (ps == &local_stack) { - for (s = *ps; s && s != scope_stack_bottom; s = s->prev) - if (!(v & SYM_FIELD) && (v & ~SYM_STRUCT) < SYM_FIRST_ANOM && s->v == v) - tcc_error("incompatible types for redefinition of '%s'", - get_tok_str(v, NULL)); + if (!tcc_state->no_type_redef_check) { + if (ps == &local_stack) { + for (s = *ps; s && s != scope_stack_bottom; s = s->prev) + if (!(v & SYM_FIELD) && (v & ~SYM_STRUCT) < SYM_FIRST_ANOM && s->v == v) + tcc_error("incompatible types for redefinition of '%s'", + get_tok_str(v, NULL)); + } } s = sym_malloc(); s->asm_label = 0; |
