1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-15 22:30:04 +00:00

Better error messages

git-svn-id: svn://svn.cc65.org/cc65/trunk@3119 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2004-06-10 11:02:05 +00:00
parent cb7c50a8ce
commit 300919d61f

View File

@ -191,7 +191,7 @@ static void AddEncodeToDeclaration (Declaration* D, type T, unsigned long Val)
D->Index += DECODE_SIZE; D->Index += DECODE_SIZE;
} }
static void ParseStorageClass (DeclSpec* D, unsigned DefStorage) static void ParseStorageClass (DeclSpec* D, unsigned DefStorage)
/* Parse a storage class */ /* Parse a storage class */
@ -281,7 +281,7 @@ static void ParseEnumDecl (void)
break; break;
NextToken (); NextToken ();
} }
ConsumeRCurly (); ConsumeRCurly ();
} }
@ -1109,12 +1109,15 @@ void ParseDecl (const DeclSpec* Spec, Declaration* D, unsigned Mode)
TypeCpy (D->Type + D->Index, Spec->Type); TypeCpy (D->Type + D->Index, Spec->Type);
/* Check the size of the generated type */ /* Check the size of the generated type */
if (!IsTypeFunc (D->Type) && !IsTypeVoid (D->Type) && SizeOf (D->Type) >= 0x10000) { if (!IsTypeFunc (D->Type) && !IsTypeVoid (D->Type)) {
if (D->Ident[0] != '\0') { unsigned Size = SizeOf (D->Type);
Error ("Size of `%s' is invalid", D->Ident); if (Size >= 0x10000) {
} else { if (D->Ident[0] != '\0') {
Error ("Invalid size"); Error ("Size of `%s' is invalid (0x%06X)", D->Ident, Size);
} } else {
Error ("Invalid size in declaration (0x%06X)", Size);
}
}
} }
} }