From 24a42dc064335d9c96b7e0c8b0df1afa2d6df5fe Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 4 Feb 2022 22:00:18 +0900 Subject: [PATCH] [qfcc] Emit args for ... functions with no other parameters I missed that the block was < -1, ie at least one real parameters. --- tools/qfcc/source/expr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/expr.c b/tools/qfcc/source/expr.c index 21951799c..1efde4579 100644 --- a/tools/qfcc/source/expr.c +++ b/tools/qfcc/source/expr.c @@ -2161,7 +2161,6 @@ build_function_call (expr_t *fexpr, const type_t *ftype, expr_t *params) warning (fexpr, "too few arguments"); } param_count = -ftype->t.func.num_params - 1; - emit_args = !ftype->t.func.no_va_list; } else if (ftype->t.func.num_params >= 0) { if (arg_count > ftype->t.func.num_params) { return error (fexpr, "too many arguments"); @@ -2173,6 +2172,9 @@ build_function_call (expr_t *fexpr, const type_t *ftype, expr_t *params) } param_count = ftype->t.func.num_params; } + if (ftype->t.func.num_params < 0) { + emit_args = !ftype->t.func.no_va_list; + } // params is reversed (a, b, c) -> c, b, a for (i = arg_count - 1, e = params; i >= 0; i--, e = e->next) { type_t *t;