1
0
mirror of https://github.com/cc65/cc65.git synced 2025-08-08 06:25:17 +00:00

Less excessive errors with failed array declarations.

This commit is contained in:
acqn
2021-03-14 03:39:05 +08:00
committed by Oliver Schmidt
parent dfba8d77ca
commit 18ae09f682
3 changed files with 4 additions and 6 deletions

View File

@@ -156,9 +156,8 @@ static void Parse (void)
** **
** This means that "extern int i;" will not get storage allocated. ** This means that "extern int i;" will not get storage allocated.
*/ */
if ((Decl.StorageClass & SC_FUNC) != SC_FUNC && if ((Decl.StorageClass & SC_FUNC) != SC_FUNC &&
(Decl.StorageClass & SC_TYPEMASK) != SC_TYPEDEF && (Decl.StorageClass & SC_TYPEMASK) != SC_TYPEDEF) {
(Decl.StorageClass & SC_FICTITIOUS) != SC_FICTITIOUS) {
if ((Spec.Flags & DS_DEF_STORAGE) != 0 || if ((Spec.Flags & DS_DEF_STORAGE) != 0 ||
(Decl.StorageClass & (SC_EXTERN|SC_STATIC)) == SC_STATIC || (Decl.StorageClass & (SC_EXTERN|SC_STATIC)) == SC_STATIC ||
((Decl.StorageClass & SC_EXTERN) != 0 && ((Decl.StorageClass & SC_EXTERN) != 0 &&

View File

@@ -2080,7 +2080,7 @@ void ParseDecl (const DeclSpec* Spec, Declaration* D, declmode_t Mode)
if (PrevErrorCount != ErrorCount) { if (PrevErrorCount != ErrorCount) {
/* Make the declaration fictitious if is is not parsed correctly */ /* Make the declaration fictitious if is is not parsed correctly */
D->StorageClass |= SC_DECL | SC_FICTITIOUS; D->StorageClass |= SC_FICTITIOUS;
if (Mode == DM_NEED_IDENT && D->Ident[0] == '\0') { if (Mode == DM_NEED_IDENT && D->Ident[0] == '\0') {
/* Use a fictitious name for the identifier if it is missing */ /* Use a fictitious name for the identifier if it is missing */

View File

@@ -476,8 +476,7 @@ static void ParseOneDecl (const DeclSpec* Spec)
} }
/* If the symbol is not marked as external, it will be defined now */ /* If the symbol is not marked as external, it will be defined now */
if ((Decl.StorageClass & SC_FICTITIOUS) == 0 && if ((Decl.StorageClass & SC_DECL) == 0 &&
(Decl.StorageClass & SC_DECL) == 0 &&
(Decl.StorageClass & SC_EXTERN) == 0) { (Decl.StorageClass & SC_EXTERN) == 0) {
Decl.StorageClass |= SC_DEF; Decl.StorageClass |= SC_DEF;
} }