From 300919d61f81459ad59e3c619e0bea61c8ec01a2 Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 10 Jun 2004 11:02:05 +0000 Subject: [PATCH] Better error messages git-svn-id: svn://svn.cc65.org/cc65/trunk@3119 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/declare.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/cc65/declare.c b/src/cc65/declare.c index c536e4c7e..b1be47753 100644 --- a/src/cc65/declare.c +++ b/src/cc65/declare.c @@ -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); + } + } } } -- 2.39.5