scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 3b828bbd092e2bcdc06371f6cdb915c1fa49a6ff
parent 4c4c232a9f307952470065c30c82048decb8c6fd
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 22 Apr 2014 17:08:30 +0200

Allow conversions to void

This is a valid cast from scalar types to void,
so thiy must be accepted.

Diffstat:
expr.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/expr.c b/expr.c @@ -114,7 +114,7 @@ convert(Node *np, Type *tp, char iscast) case PTR: if (!iscast || np->typeop == FLOAT) return NULL; - case INT: case FLOAT: case ENUM: + case INT: case FLOAT: case ENUM: case VOID: break; default: return NULL; @@ -122,7 +122,7 @@ convert(Node *np, Type *tp, char iscast) break; case PTR: switch (t) { - case ENUM: case INT: /* TODO: allow p = 0 */ + case ENUM: case INT: case VOID: /* TODO: allow p = 0 */ if (!iscast) return NULL;; break;