From: Christoph Mallon Date: Wed, 20 Aug 2008 12:47:45 +0000 (+0000) Subject: Slightly reduce code duplication. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=f75abd85e257f86baa8d24cbdb9fc2cb074e1fa4;p=cparser Slightly reduce code duplication. [r21280] --- diff --git a/parser.c b/parser.c index ed42823..9293447 100644 --- a/parser.c +++ b/parser.c @@ -4042,11 +4042,11 @@ static void check_type_of_main(const declaration_t *const decl, const function_t "third argument of 'main' should be 'char**', but is '%T'", third_type); } parm = parm->next; - if (parm != NULL) { - warningf(&decl->source_position, "'main' takes only zero, two or three arguments"); - } + if (parm != NULL) + goto warn_arg_count; } } else { +warn_arg_count: warningf(&decl->source_position, "'main' takes only zero, two or three arguments"); } }