From 2c5c8f3bca082c0822a9b2a247689b882980cc47 Mon Sep 17 00:00:00 2001 From: lemon Date: Wed, 15 Oct 2025 10:05:01 +0200 Subject: c: redeclaration ok when old was unspecified length array --- c.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'c.c') 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; } -- cgit v1.2.3