From: Christoph Mallon Date: Thu, 16 Jun 2011 13:47:33 +0000 (+0200) Subject: Remove if (type != NULL), which due to prior program logic cannot be false. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=f3039990ff6fd500a6ed6a79d00e04c4fad5c639;hp=64e0eba682896a84bd32d8edab846d2bb8dff2fa;p=cparser Remove if (type != NULL), which due to prior program logic cannot be false. --- 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 == '}') {