From: Christoph Mallon Date: Tue, 27 Nov 2007 15:40:15 +0000 (+0000) Subject: A function declaration with unspecified parameter list is compatible to a declaration... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=8606fc530037e67b94d9e0416e95ec3bf3aff1e1;p=cparser A function declaration with unspecified parameter list is compatible to a declaration with a parameter list. [r18553] --- diff --git a/parser.c b/parser.c index e1db29c..19b00c0 100644 --- a/parser.c +++ b/parser.c @@ -443,6 +443,17 @@ static void set_context(context_t *new_context) static bool is_compatible_declaration (declaration_t *declaration, declaration_t *previous) { + if (declaration->type->type == TYPE_FUNCTION && + previous->type->type == TYPE_FUNCTION && + previous->type->function.unspecified_parameters) { + function_type_t* const prev_func = &previous->type->function; + function_type_t* const decl_func = &declaration->type->function; + if (prev_func->unspecified_parameters && + prev_func->result_type == decl_func->result_type) { + declaration->type = previous->type; + return true; + } + } /* TODO: not correct yet */ return declaration->type == previous->type; }