[hackers] [scc] [cc1] Allow conversions between pointers to equivalent types || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 9 Aug 2016 14:25:44 +0200 (CEST)

commit cc438f5538915a874dd03bf8b24f2556862db280
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Aug 9 13:41:33 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
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
_AT_@ -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;
Received on Tue Aug 09 2016 - 14:25:44 CEST

This archive was generated by hypermail 2.3.0 : Tue Aug 09 2016 - 14:36:19 CEST