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)