From f79e34628bf60c1253b13485ee05c7d54382d73f Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 4 Feb 2004 02:30:18 +0000 Subject: [PATCH] broke returning NIL --- tools/qfcc/source/expr.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/qfcc/source/expr.c b/tools/qfcc/source/expr.c index fc5ce0ff0..acfd1642d 100644 --- a/tools/qfcc/source/expr.c +++ b/tools/qfcc/source/expr.c @@ -1949,11 +1949,15 @@ return_expr (function_t *f, expr_t *e) t = &type_float; } if (t == &type_void) { - if (!options.traditional) - return error (e, "void value not ignored as it ought to be"); - warning (e, "void value not ignored as it ought to be"); - t = f->def->type->aux_type; - e->type = expr_types[t->type]; + if (e->type == ex_nil) { + t = f->def->type->aux_type; + e->type = expr_types[t->type]; + } else { + if (!options.traditional) + return error (e, "void value not ignored as it ought to be"); + warning (e, "void value not ignored as it ought to be"); + //FIXME does anything need to be done here? + } } if (!type_assignable (f->def->type->aux_type, t)) { if (!options.traditional)