aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/evaluate.c
diff options
Diffstat (limited to 'evaluate.c')
-rw-r--r--evaluate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/evaluate.c b/evaluate.c
index e3b49407..07ebf0c4 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -2790,6 +2790,8 @@ static struct symbol *evaluate_return_expression(struct statement *stmt)
if (!fntype || fntype == &void_ctype) {
if (expr && expr->ctype != &void_ctype)
expression_error(expr, "return expression in %s function", fntype?"void":"typeless");
+ if (expr && Wreturn_void)
+ warning(stmt->pos, "returning void-valued expression");
return NULL;
}