if "const" specified with other storage class then storage class prevails
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 19 Dec 2001 05:10:46 +0000 (05:10 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 19 Dec 2001 05:10:46 +0000 (05:10 +0000)
don't put the variable into code segment

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1713 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCsymt.c

index 47cf210b1fe2da9e711e0a8c0e88ec443c33e834..5592d4a908e08e45ee7a0067ba0fe432c0de4818 100644 (file)
@@ -1181,8 +1181,10 @@ checkSClass (symbol * sym, int isProto)
     SPEC_VOLATILE (sym->etype) = 1;
   
   /* global variables declared const put into code */
+  /* if no other storage class specified */
   if (sym->level == 0 &&
-      SPEC_CONST (sym->etype)) {
+      SPEC_CONST (sym->etype) &&
+      SPEC_SCLS(sym->etype) == S_FIXED) {
     SPEC_SCLS (sym->etype) = S_CODE;
   }