aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/evaluate.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-12-29 14:10:06 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-12-29 14:12:43 +0100
commitfa232154d6717107d2941498103f95e1e3ee4252 (patch)
tree1320ebe1aa4516673f858b7ee3f9a0562672f290 /evaluate.c
parentaef334a2ccad268c5511590356372393d37931d8 (diff)
downloadsparse-dev-fa232154d6717107d2941498103f95e1e3ee4252.tar.gz
explain cause of 'incorrect type in conditional'
A conditional only make sense on a scalar type. If not, an error is issued but the message doesn't explain the cause. Fix this by adding the cause to the error message. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'evaluate.c')
-rw-r--r--evaluate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/evaluate.c b/evaluate.c
index 8841a6e4..341fed9d 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -910,7 +910,7 @@ static struct symbol *evaluate_conditional(struct expression *expr, int iterator
if (Waddress)
warning(expr->pos, "the address of %s will always evaluate as true", "an array");
} else if (!is_scalar_type(ctype)) {
- sparse_error(expr->pos, "incorrect type in conditional");
+ sparse_error(expr->pos, "incorrect type in conditional (non-scalar type)");
info(expr->pos, " got %s", show_typename(ctype));
return NULL;
}