fixed bug #466587
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 1 Oct 2001 09:49:15 +0000 (09:49 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 1 Oct 2001 09:49:15 +0000 (09:49 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1334 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCicode.c

index e8d37a8343d553159b070aaff27e6386586dd66a..30bd5985e4fe14c329f779484eac17295f81ab0f 100644 (file)
@@ -1602,7 +1602,7 @@ geniCodeCast (sym_link * type, operand * op, bool implicit)
       if (IS_INTEGRAL(optype)) { 
        // maybe this is NULL, than it's ok.
        if (!(IS_LITERAL(optype) && (SPEC_CVAL(optype).v_ulong ==0))) {
-         if (IS_GENPTR(type)) {
+         if (!TARGET_IS_Z80 && !TARGET_IS_GBZ80 && IS_GENPTR(type)) {
            // no way to set the storage
            if (IS_LITERAL(optype)) {
              werror(E_LITERAL_GENERIC);
@@ -1625,10 +1625,12 @@ geniCodeCast (sym_link * type, operand * op, bool implicit)
        }
       }
     } else { // from a pointer to a pointer
-      if (implicit) { // if not to generic, they have to match 
-       if ((!IS_GENPTR(type) && (DCL_TYPE(optype) != DCL_TYPE(type)))) {
-         werror(E_INCOMPAT_PTYPES);
-         errors++;
+      if (!TARGET_IS_Z80 && !TARGET_IS_GBZ80) {
+       if (implicit) { // if not to generic, they have to match 
+         if ((!IS_GENPTR(type) && (DCL_TYPE(optype) != DCL_TYPE(type)))) {
+           werror(E_INCOMPAT_PTYPES);
+           errors++;
+         }
        }
       }
     }