]> git.sur5r.net Git - cc65/blobdiff - src/cc65/typecast.c
ValidSegName now defined in segnames.h
[cc65] / src / cc65 / typecast.c
index 406680a7732c91df0f28c9023aee2d585eda6f53..4984192f4f51f25a43d52a9242546209db68494d 100644 (file)
@@ -73,9 +73,13 @@ int TypeCast (ExprDesc* lval)
     /* Read the expression we have to cast */
     k = hie10 (lval);
 
-    /* If the expression is a function, treat it as pointer-to-function */
+    /* If the expression is a function, treat it as pointer to function.
+     * If the expression is an array, treat it as pointer to first element.
+     */
     if (IsTypeFunc (lval->Type)) {
        lval->Type = PointerTo (lval->Type);
+    } else if (IsTypeArray (lval->Type)) {
+        lval->Type = ArrayToPtr (lval->Type);
     }
 
     /* Remember the old type */