From 334d6479c8e1a963d8b9736b82e678017f03018f Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Tue, 18 Nov 2008 14:54:54 +0000 Subject: [PATCH] One more fix for r23739: extern declarations may be incomplete. [r23762] --- parser.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/parser.c b/parser.c index 2825e68..ca0e03e 100644 --- a/parser.c +++ b/parser.c @@ -5154,11 +5154,16 @@ static void check_variable_type_complete(entity_t *ent) if (ent->kind != ENTITY_VARIABLE) return; - type_t *type = ent->declaration.type; - if (is_type_incomplete(skip_typeref(type))) { - errorf(&ent->base.source_position, - "variable '%#T' is of incomplete type", type, ent->base.symbol); - } + declaration_t *decl = &ent->declaration; + if (decl->storage_class == STORAGE_CLASS_EXTERN) + return; + + type_t *type = decl->type; + if (!is_type_incomplete(skip_typeref(type))) + return; + + errorf(&ent->base.source_position, + "variable '%#T' is of incomplete type", type, ent->base.symbol); } -- 2.20.1