* device/include/pic16/{pic18f2480.h, pic18f2580.h, pic18f4423.h,
[fw/sdcc] / src / SDCCsymt.c
index b9d4175a6e5a35d302441237f08049ec58b94765..94ad4d70705893e2e8879f845a49f35395165c9f 100644 (file)
@@ -1213,6 +1213,8 @@ structElemType (sym_link * stype, value * id)
             etype = getSpec (type);
             SPEC_SCLS (etype) = (SPEC_SCLS (petype) == S_REGISTER ?
                                  SPEC_SCLS (etype) : SPEC_SCLS (petype));
+            SPEC_OCLS (etype) = (SPEC_SCLS (petype) == S_REGISTER ?
+                                 SPEC_OCLS (etype) : SPEC_OCLS (petype));
             if (IS_SPEC (type))
               SPEC_CONST (type) |= SPEC_CONST (stype);
             else
@@ -2050,7 +2052,7 @@ comparePtrType (sym_link * dest, sym_link * src, bool bMustCast)
   int res;
 
   if (IS_VOID (src->next) && IS_VOID (dest->next))
-    return 1;
+    return bMustCast ? -1 : 1;
   if ((IS_VOID (src->next) && !IS_VOID (dest->next)) ||
       (!IS_VOID (src->next) && IS_VOID (dest->next)) )
     return -1;
@@ -2424,6 +2426,8 @@ aggregateToPointer (value * val)
           }
           break;
         case S_AUTO:
+          DCL_TYPE (val->type) = PTR_TYPE(SPEC_OCLS(val->etype));
+          break;
         case S_DATA:
         case S_REGISTER:
           DCL_TYPE (val->type) = POINTER;