mirror of
https://github.com/cc65/cc65.git
synced 2024-12-28 06:30:16 +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:
parent
cb7c50a8ce
commit
300919d61f
@ -191,7 +191,7 @@ static void AddEncodeToDeclaration (Declaration* D, type T, unsigned long Val)
|
||||
D->Index += DECODE_SIZE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static void ParseStorageClass (DeclSpec* D, unsigned DefStorage)
|
||||
/* Parse a storage class */
|
||||
@ -281,7 +281,7 @@ static void ParseEnumDecl (void)
|
||||
break;
|
||||
NextToken ();
|
||||
}
|
||||
ConsumeRCurly ();
|
||||
ConsumeRCurly ();
|
||||
}
|
||||
|
||||
|
||||
@ -1109,12 +1109,15 @@ void ParseDecl (const DeclSpec* Spec, Declaration* D, unsigned Mode)
|
||||
TypeCpy (D->Type + D->Index, Spec->Type);
|
||||
|
||||
/* Check the size of the generated type */
|
||||
if (!IsTypeFunc (D->Type) && !IsTypeVoid (D->Type) && SizeOf (D->Type) >= 0x10000) {
|
||||
if (D->Ident[0] != '\0') {
|
||||
Error ("Size of `%s' is invalid", D->Ident);
|
||||
} else {
|
||||
Error ("Invalid size");
|
||||
}
|
||||
if (!IsTypeFunc (D->Type) && !IsTypeVoid (D->Type)) {
|
||||
unsigned Size = SizeOf (D->Type);
|
||||
if (Size >= 0x10000) {
|
||||
if (D->Ident[0] != '\0') {
|
||||
Error ("Size of `%s' is invalid (0x%06X)", D->Ident, Size);
|
||||
} else {
|
||||
Error ("Invalid size in declaration (0x%06X)", Size);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user