From: cuz Date: Thu, 7 Mar 2002 20:59:43 +0000 (+0000) Subject: Local variables of incomplete types could be declared X-Git-Tag: V2.12.0~2442 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0b06db99d5e538f49ef0240a984047e24a5ea560;p=cc65 Local variables of incomplete types could be declared git-svn-id: svn://svn.cc65.org/cc65/trunk@1171 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- 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 */