X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCsymt.c;h=e34bad43b2d1cf0ce34103cc77a7425da8dfb618;hb=9808229661396adafad260b2422767536a6828ac;hp=009cd4a51e95269c5f41cfe1c89417cbdec43828;hpb=09f744b9eccbdf896febcac4d46e45129e639f70;p=fw%2Fsdcc diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 009cd4a5..e34bad43 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -898,8 +898,13 @@ int compStructSize (int su, structdef *sdef ) /*------------------------------------------------------------------*/ /* checkSClass - check the storage class specification */ /*------------------------------------------------------------------*/ -void checkSClass ( symbol *sym ) +static void checkSClass ( symbol *sym ) { + /* type is literal can happen foe enums change + to auto */ + if (SPEC_SCLS(sym->etype) == S_LITERAL && !SPEC_ENUM(sym->etype)) + SPEC_SCLS(sym->etype) = S_AUTO; + /* if sfr or sbit then must also be */ /* volatile the initial value will be xlated */ /* to an absolute address */ @@ -958,7 +963,7 @@ void checkSClass ( symbol *sym ) ( SPEC_SCLS(sym->etype) != S_AUTO && SPEC_SCLS(sym->etype) != S_FIXED && SPEC_SCLS(sym->etype) != S_REGISTER && - SPEC_SCLS(sym->etype) != S_CONSTANT )) { + SPEC_SCLS(sym->etype) != S_CONSTANT )) { werror(E_AUTO_ASSUMED,sym->name) ; SPEC_SCLS(sym->etype) = S_AUTO ;