From: cuz Date: Mon, 20 Jan 2003 21:02:57 +0000 (+0000) Subject: Fixed the last fix. Sigh:-( X-Git-Tag: V2.12.0~1778 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6e6560abd9c2236fc59b75416c67c746657d8d3b;p=cc65 Fixed the last fix. Sigh:-( git-svn-id: svn://svn.cc65.org/cc65/trunk@1909 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/compile.c b/src/cc65/compile.c index 9332e646e..ca5005c4d 100644 --- a/src/cc65/compile.c +++ b/src/cc65/compile.c @@ -80,9 +80,9 @@ static void Parse (void) /* Parse until end of input */ while (CurTok.Tok != TOK_CEOF) { - DeclSpec Spec; + DeclSpec Spec; Declaration Decl; - int NeedStorage; + int NeedStorage; /* Check for empty statements */ if (CurTok.Tok == TOK_SEMI) { @@ -107,11 +107,13 @@ static void Parse (void) ParseDeclSpec (&Spec, SC_EXTERN | SC_STATIC, T_INT); /* Don't accept illegal storage classes */ - if ((Spec.StorageClass & SC_AUTO) != 0 && - (Spec.StorageClass & SC_REGISTER) != 0) { - Error ("Illegal storage class"); - Spec.StorageClass = SC_EXTERN | SC_STATIC; - } + if ((Spec.StorageClass & SC_TYPE) == 0) { + if ((Spec.StorageClass & SC_AUTO) != 0 || + (Spec.StorageClass & SC_REGISTER) != 0) { + Error ("Illegal storage class"); + Spec.StorageClass = SC_EXTERN | SC_STATIC; + } + } /* Check if this is only a type declaration */ if (CurTok.Tok == TOK_SEMI) {