scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit cc438f5538915a874dd03bf8b24f2556862db280
parent 7090df164ce7ae97854a3b991427160d2d79dac6
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue,  9 Aug 2016 13:41:33 +0200

[cc1] Allow conversions between pointers to equivalent types

This is explicitly allowed by the standard, and it makes sense.

Diffstat:
Mcc1/expr.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cc1/expr.c b/cc1/expr.c @@ -292,7 +292,8 @@ convert(Node *np, Type *newtp, char iscast) return NULL; break; case PTR: - if (iscast || + if (eqtype(newtp, oldtp, 1) || + iscast || newtp == pvoidtype || oldtp == pvoidtype) { np->type = newtp; return np;