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
1253 } else {1253 } else {
1254 if ((sym->type.t & VT_ARRAY) && type->ref->c >= 0) {1254 if ((sym->type.t & VT_ARRAY) && type->ref->c >= 0) {
1255 /* set array size if it was omitted in extern declaration */1255 /* set array size if it was omitted in extern declaration */
1256 sym->type.ref->c = type->ref->c;1256 sym->type.ref = type->ref;
1257 }1257 }
1258 if ((type->t ^ sym->type.t) & VT_STATIC)1258 if ((type->t ^ sym->type.t) & VT_STATIC)
1259 tcc_warning("storage mismatch for redefinition of '%s'",1259 tcc_warning("storage mismatch for redefinition of '%s'",
tests/tcctest.c+4−0
@@ -1767,9 +1767,13 @@ struct complexinit2 cix22 = { · 1766 unmodified lines
1767};1767};
1768 1768
1769typedef int arrtype1[];1769typedef int arrtype1[];
1770arrtype1 sinit19;
1771arrtype1 sinit20;
1770arrtype1 sinit19 = {1};1772arrtype1 sinit19 = {1};
1771arrtype1 sinit20 = {2,3};1773arrtype1 sinit20 = {2,3};
1772typedef int arrtype2[3];1774typedef int arrtype2[3];
1775arrtype2 sinit21;
1776arrtype2 sinit22;
1773arrtype2 sinit21 = {4};1777arrtype2 sinit21 = {4};
1774arrtype2 sinit22 = {5,6,7};1778arrtype2 sinit22 = {5,6,7};
1775 1779

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