aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-10-15 10:05:01 +0200
committerlemon <lsof@mailbox.org>2025-10-15 10:05:01 +0200
commit2c5c8f3bca082c0822a9b2a247689b882980cc47 (patch)
tree921087ff864019069cb59d175bbe8d5de136a96f
parentb0413b4978698d964c381777b7b95d79d0fbd25f (diff)
c: redeclaration ok when old was unspecified length array
-rw-r--r--c.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/c.c b/c.c
index 8109a9b..0f4c0f1 100644
--- a/c.c
+++ b/c.c
@@ -207,6 +207,13 @@ redeclarationok(const struct decl *old, const struct decl *new)
break;
/*fallthru*/
case SCEXTERN:
+ if (old->ty.t == TYARRAY && new->ty.t == TYARRAY
+ && typechild(old->ty).bits == typechild(new->ty).bits
+ && isincomplete(old->ty))
+ {
+ return 1;
+ }
+ /*fallthru*/
case SCTYPEDEF:
return old->ty.bits == new->ty.bits;
}