diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-12-29 14:10:06 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-12-29 14:12:43 +0100 |
| commit | fa232154d6717107d2941498103f95e1e3ee4252 (patch) | |
| tree | 1320ebe1aa4516673f858b7ee3f9a0562672f290 /evaluate.c | |
| parent | aef334a2ccad268c5511590356372393d37931d8 (diff) | |
| download | sparse-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } |
