]> git.sur5r.net Git - cc65/commitdiff
Local variables of incomplete types could be declared
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 7 Mar 2002 20:59:43 +0000 (20:59 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 7 Mar 2002 20:59:43 +0000 (20:59 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1171 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/cc65/locals.c

index fccc8040e94429ffd5f36384ce1efbcba9f7b146..51ebd30f6d932334d4bad6c57dd4c0de4acbe862 100644 (file)
@@ -171,6 +171,13 @@ static void ParseOneDecl (const DeclSpec* Spec)
        /* Get the size of the variable */
        Size = SizeOf (Decl.Type);
 
+        /* Cannot allocate a variable of zero size */
+        if (Size == 0) {
+            Error ("Variable `%s' has unknown size", Decl.Ident);
+            return;
+        }
+
+        /* */
                if (SC & (SC_AUTO | SC_REGISTER)) {
 
            /* Auto variable */