]> andersk Git - splint.git/blobdiff - src/exprNode.c
Fixed problem with global struct assignments.
[splint.git] / src / exprNode.c
index 62b44f8b35e815adfa9f26800c499059d84eaf8b..7af8f10720673667cff5194eda0aaf1dec27b751 100644 (file)
@@ -10679,8 +10679,20 @@ static ctype
          DPRINTF (("No error: [%s] %s / [%s]  %s",
                    exprNode_unparse (e1), ctype_unparse (tr1),
                    exprNode_unparse (e2), ctype_unparse (tr2)));
+         
+         /*
+         ** evans 2003-06-15: changed this so if either type is a literal,
+         **    the other type is used.
+         **    (Need to look at the ISO C99 rules on this...)
+         */
 
-         ret = ctype_biggerType (tr1, tr2);
+         if (exprNode_isNumLiteral (e1)) {
+           ret = tr2;
+         } else if (exprNode_isNumLiteral (e2)) {
+           ret = tr1;
+         } else {
+           ret = ctype_biggerType (tr1, tr2);
+         }
        }
       else
        {
This page took 0.032573 seconds and 4 git commands to generate.