Better error messages
git-svn-id: svn://svn.cc65.org/cc65/trunk@3119 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user