From 0b06db99d5e538f49ef0240a984047e24a5ea560 Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 7 Mar 2002 20:59:43 +0000 Subject: [PATCH] Local variables of incomplete types could be declared git-svn-id: svn://svn.cc65.org/cc65/trunk@1171 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/locals.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cc65/locals.c b/src/cc65/locals.c index fccc8040e..51ebd30f6 100644 --- a/src/cc65/locals.c +++ b/src/cc65/locals.c @@ -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 */ -- 2.39.5