diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2007-06-20 19:05:13 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2007-06-25 15:51:43 -0400 |
commit | f78588abcebac0462764e5c8a3c91fa7a13bad45 (patch) | |
tree | ad9a707cf2ac3e5ac730b33887361ff842f97919 /evaluate.c | |
parent | [PATCH] in case of compound literal we want to delay examining type (diff) | |
download | sparse-f78588abcebac0462764e5c8a3c91fa7a13bad45.tar.gz sparse-f78588abcebac0462764e5c8a3c91fa7a13bad45.tar.bz2 sparse-f78588abcebac0462764e5c8a3c91fa7a13bad45.zip |
[PATCH] warn on return <void expression>;
conditional on -Wreturn-void
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'evaluate.c')
-rw-r--r-- | evaluate.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; } |