From: johanknol Date: Sun, 5 Jan 2003 16:38:49 +0000 (+0000) Subject: Small fix for implicit integral promotion X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=c5eb990ef4c01a86da8fef5329e90c5e693c1a26;p=fw%2Fsdcc Small fix for implicit integral promotion git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2136 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCast.c b/src/SDCCast.c index f8d5e58c..fa103570 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -1977,7 +1977,8 @@ decorateType (ast * tree) (getSize(LTYPE(tree)) > getSize(RTYPE(tree))) && (getSize(RTYPE(tree)) < INTSIZE)) { // this is a cast/assign to a bigger type - if (IS_AST_OP(tree->right) && + if (IS_AST_OP(tree->right) && + IS_INTEGRAL(tree->right->ftype) && (tree->right->opval.op == LEFT_OP || tree->right->opval.op == '*' || tree->right->opval.op == '+' || @@ -2501,7 +2502,7 @@ decorateType (ast * tree) LRVAL (tree) = RRVAL (tree) = 1; /* if the left is a pointer */ - if (IS_PTR (LTYPE (tree)) || IS_ARRAY (LTYPE (tree))) + if (IS_PTR (LTYPE (tree)) || IS_AGGREGATE (LTYPE (tree)) ) TETYPE (tree) = getSpec (TTYPE (tree) = LTYPE (tree)); else diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 2721c1d8..20ee30ad 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -2030,7 +2030,11 @@ printTypeChain (sym_link * start, FILE * of) fprintf (of, "unkown * "); break; case ARRAY: - fprintf (of, "[] "); + if (DCL_ELEM(type)) { + fprintf (of, "[%d] ", DCL_ELEM(type)); + } else { + fprintf (of, "[] "); + } break; } }