fixed bug #524209
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 1 Mar 2002 10:31:52 +0000 (10:31 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 1 Mar 2002 10:31:52 +0000 (10:31 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1961 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCast.c

index e96afef1c9cc0d444bac4f1c466eb109e65f117c..b6f7cbfbd3a48a4511d631a1aba1463b46dcc1f4 100644 (file)
@@ -2150,8 +2150,6 @@ decorateType (ast * tree)
        {
          // this ought to be ignored
          return (tree->left);
-         //werror (E_ILLEGAL_ADDR, "address of function");
-         //goto errorTreeReturn;
        }
 
       if (IS_LITERAL(LTYPE(tree)))
@@ -2736,12 +2734,16 @@ decorateType (ast * tree)
              LRVAL (tree) = 1;
       }
 #else
+#if 0 // this is already checked, now this could be explicit
       /* if pointer to struct then check names */
       if (IS_PTR(LTYPE(tree)) && IS_STRUCT(LTYPE(tree)->next) &&
          IS_PTR(RTYPE(tree)) && IS_STRUCT(RTYPE(tree)->next) &&
-         strcmp(SPEC_STRUCT(LETYPE(tree))->tag,SPEC_STRUCT(RETYPE(tree))->tag)) {
-             werror(W_CAST_STRUCT_PTR,SPEC_STRUCT(RETYPE(tree))->tag,SPEC_STRUCT(LETYPE(tree))->tag);
-      }
+         strcmp(SPEC_STRUCT(LETYPE(tree))->tag,SPEC_STRUCT(RETYPE(tree))->tag)) 
+       {
+         werror(W_CAST_STRUCT_PTR,SPEC_STRUCT(RETYPE(tree))->tag,
+                SPEC_STRUCT(LETYPE(tree))->tag);
+       }
+#endif
       /* if the right is a literal replace the tree */
       if (IS_LITERAL (RETYPE (tree)) && !IS_PTR (LTYPE (tree))) {
        tree->type = EX_VALUE;