mirror of
git://repo.or.cz/tinycc.git
synced 2026-06-17 23:54:16 +08:00
Unshare typedef definitions if it used more then once.
This commit is contained in:
parent
8a0ccbbd94
commit
80bef6162a
2
tccgen.c
2
tccgen.c
@ -1253,7 +1253,7 @@ static void patch_type(Sym *sym, CType *type)
|
||||
} else {
|
||||
if ((sym->type.t & VT_ARRAY) && type->ref->c >= 0) {
|
||||
/* set array size if it was omitted in extern declaration */
|
||||
sym->type.ref->c = type->ref->c;
|
||||
sym->type.ref = type->ref;
|
||||
}
|
||||
if ((type->t ^ sym->type.t) & VT_STATIC)
|
||||
tcc_warning("storage mismatch for redefinition of '%s'",
|
||||
|
||||
@ -1767,9 +1767,13 @@ struct complexinit2 cix22 = {
|
||||
};
|
||||
|
||||
typedef int arrtype1[];
|
||||
arrtype1 sinit19;
|
||||
arrtype1 sinit20;
|
||||
arrtype1 sinit19 = {1};
|
||||
arrtype1 sinit20 = {2,3};
|
||||
typedef int arrtype2[3];
|
||||
arrtype2 sinit21;
|
||||
arrtype2 sinit22;
|
||||
arrtype2 sinit21 = {4};
|
||||
arrtype2 sinit22 = {5,6,7};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user