From f3039990ff6fd500a6ed6a79d00e04c4fad5c639 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Thu, 16 Jun 2011 15:47:33 +0200 Subject: [PATCH] Remove if (type != NULL), which due to prior program logic cannot be false. --- parser.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/parser.c b/parser.c index 4fc3804..801b2ec 100644 --- a/parser.c +++ b/parser.c @@ -2202,10 +2202,18 @@ finish_designator: goto error_parse_next; type_t *const outer_type_skip = skip_typeref(outer_type); if (is_type_compound(outer_type_skip) && - !outer_type_skip->compound.compound->complete) { + !outer_type_skip->compound.compound->complete) { goto error_parse_next; } - goto error_excess; + + if (warning.other) { + if (env->entity != NULL) { + warningf(HERE, "excess elements in initializer for '%Y'", env->entity->base.symbol); + } else { + warningf(HERE, "excess elements in initializer"); + } + } + goto error_parse_next; } /* handle { "string" } special case */ @@ -2257,20 +2265,8 @@ finish_designator: path->max_index = index; } - if (type != NULL) { - /* append to initializers list */ - ARR_APP1(initializer_t*, initializers, sub); - } else { -error_excess: - if (warning.other) { - if (env->entity != NULL) { - warningf(HERE, "excess elements in initializer for '%Y'", - env->entity->base.symbol); - } else { - warningf(HERE, "excess elements in initializer"); - } - } - } + /* append to initializers list */ + ARR_APP1(initializer_t*, initializers, sub); error_parse_next: if (token.type == '}') { -- 2.20.1