Fixed several problems
[fw/sdcc] / src / SDCCsymt.c
index 009cd4a51e95269c5f41cfe1c89417cbdec43828..e34bad43b2d1cf0ce34103cc77a7425da8dfb618 100644 (file)
@@ -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   ;