commit cc438f5538915a874dd03bf8b24f2556862db280
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Tue Aug 9 13:41:33 2016 +0200
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Tue Aug 9 13:41:33 2016 +0200

    [cc1] Allow conversions between pointers to equivalent types
    
    This is explicitly allowed by the standard, and it makes sense.

diff --git a/cc1/expr.c b/cc1/expr.c
index 29ea4db..281ac13 100644
--- 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;

Reply via email to