the next step in advanced type checking
[fw/sdcc] / src / SDCCast.c
index 4abbdc67309066ffabae0b332e8899e16e49ed04..9c62ab82694c47225b089e27c8fe25a73db1d472 100644 (file)
@@ -2633,6 +2633,9 @@ decorateType (ast * tree)
          werror (E_CAST_ILLEGAL);
          goto errorTreeReturn;
        }
+      
+      /* make sure the type is complete and sane */
+      checkTypeSanity(LETYPE(tree), "(cast)");
 
       /* if the right is a literal replace the tree */
       if (IS_LITERAL (RETYPE (tree)) && !IS_PTR (LTYPE (tree)))
@@ -3167,6 +3170,9 @@ sizeofOp (sym_link * type)
 {
   char buff[10];
 
+  /* make sure the type is complete and sane */
+  checkTypeSanity(type, "(sizeof)");
+
   /* get the size and convert it to character  */
   sprintf (buff, "%d", getSize (type));