]> git.gag.com Git - fw/sdcc/commitdiff
fixed bug #467893
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 8 Oct 2001 13:44:41 +0000 (13:44 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 8 Oct 2001 13:44:41 +0000 (13:44 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1376 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCC.y
src/SDCCicode.c
support/Util/SDCCerr.c

index 954010939580ec2aaf9efb5c8d1a4e636cd3cfa4..3306c3ee91a43da13b92c83c2de89afde59723f7 100644 (file)
@@ -756,11 +756,11 @@ struct_declaration
               if (!sym->type) {
                   sym->type = copyLinkChain($1);
                   sym->etype = getSpec(sym->type);
-                  /* make sure the type is complete and sane */
-                  checkTypeSanity(sym->etype, sym->name);
               }
               else
                   addDecl (sym,0,cloneSpec($1));              
+              /* make sure the type is complete and sane */
+              checkTypeSanity(sym->etype, sym->name);
           }
            $$ = $2;
        }
index 7b5aa849b764d8ef25b31c5034511edef3b83ac5..0adff9fbe2ad7778f8e4e96716570cbabd115a75 100644 (file)
@@ -1599,7 +1599,7 @@ geniCodeCast (sym_link * type, operand * op, bool implicit)
 
   /* if casting to/from pointers, do some checking */
   if (IS_PTR(type)) { // to a pointer
-    if (!IS_PTR(optype) && !IS_FUNC(optype)) { // from a non pointer
+    if (!IS_PTR(optype) && !IS_FUNC(optype) && !IS_AGGREGATE(optype)) { // from a non pointer
       if (IS_INTEGRAL(optype)) { 
        // maybe this is NULL, than it's ok.
        if (!(IS_LITERAL(optype) && (SPEC_CVAL(optype).v_ulong ==0))) {
index ad1e1abee9c06cc335ddd7a6cd091c90fd7e546a..8287a867958f17328561e118fec30ec760e392a0 100644 (file)
@@ -145,7 +145,7 @@ struct
    "operand invalid for bitwise operation" },
 { E_ANDOR_OP, ERROR_LEVEL_ERROR,
    "Invalid operand for '&&' or '||'" },
-{ E_TYPE_MISMATCH, ERROR_LEVEL_WARNING,
+{ E_TYPE_MISMATCH, ERROR_LEVEL_ERROR,
    "indirections to different types %s %s " },
 { E_AGGR_ASSIGN, ERROR_LEVEL_ERROR,
    "cannot assign values to aggregates" },