From 53c4c205cacf96a69fe5d43d8ee47acf5d58c2a2 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 24 Nov 2024 13:03:34 +0900 Subject: [PATCH] [qfcc] Override function declaration with definition This fixes the problem of the function declaration parameter names overriding the definition's parameter names. --- tools/qfcc/source/function.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/qfcc/source/function.c b/tools/qfcc/source/function.c index cd473d14e..02873e5a8 100644 --- a/tools/qfcc/source/function.c +++ b/tools/qfcc/source/function.c @@ -839,10 +839,11 @@ function_symbol (specifier_t spec) s = new_symbol (name); s->sy_type = sy_func; s->type = unalias_type (sym->type); - s->params = sym->params; - s->metafunc = func; symtab_addsymbol (current_symtab, s); } + //if it existed, override the declaration's parameters and metafunc + s->params = sym->params; + s->metafunc = func; return s; }