History

Unshare typedef definitions if it used more then once.

herman ten brugge committed 1 year ago

Commit 80bef611 parent 8a0ccbb2 files · +5 −1Browse files

Unified · Split

2 files
  1. tccgen.c +1 −1
  2. tests/tcctest.c +4 −0
tccgen.c+1−1
@@ -1253,7 +1253,7 @@ static void patch_type(Sym *sym, CType *type) · 1252 unmodified lines
12531253 } else {
12541254 if ((sym->type.t & VT_ARRAY) && type->ref->c >= 0) {
12551255 /* set array size if it was omitted in extern declaration */
1256− sym->type.ref->c = type->ref->c;
1256+ sym->type.ref = type->ref;
12571257 }
12581258 if ((type->t ^ sym->type.t) & VT_STATIC)
12591259 tcc_warning("storage mismatch for redefinition of '%s'",
tests/tcctest.c+4−0
@@ -1767,9 +1767,13 @@ struct complexinit2 cix22 = { · 1766 unmodified lines
17671767 };
17681768
17691769 typedef int arrtype1[];
1770+arrtype1 sinit19;
1771+arrtype1 sinit20;
17701772 arrtype1 sinit19 = {1};
17711773 arrtype1 sinit20 = {2,3};
17721774 typedef int arrtype2[3];
1775+arrtype2 sinit21;
1776+arrtype2 sinit22;
17731777 arrtype2 sinit21 = {4};
17741778 arrtype2 sinit22 = {5,6,7};
17751779

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t