a function returning a constant pointer shouldn't be forced to code
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 13 Mar 2003 19:36:56 +0000 (19:36 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 13 Mar 2003 19:36:56 +0000 (19:36 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2387 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCsymt.c

index 0dce6fa4a2e08e20d43c8aa840aef4182c3691fa..7e5e40a5cc6bdd0b54ea67c63912e419249fe01a 100644 (file)
@@ -1174,7 +1174,8 @@ checkSClass (symbol * sym, int isProto)
   /* if no other storage class specified */
   if (sym->level == 0 &&
       SPEC_CONST (sym->etype) &&
-      SPEC_SCLS(sym->etype) == S_FIXED) {
+      SPEC_SCLS(sym->etype) == S_FIXED &&
+      !IS_FUNC(sym->type)) {
     SPEC_SCLS (sym->etype) = S_CODE;
   }
   
@@ -1589,23 +1590,8 @@ aggregateToPointer (value * val)
          if (SPEC_OCLS(val->etype)) {
            DCL_TYPE(val->type)=PTR_TYPE(SPEC_OCLS(val->etype));
          } else {
-#if 1
            // this happens for (external) function parameters
            DCL_TYPE (val->type) = port->unqualified_pointer;
-#else
-           if (TARGET_IS_DS390) {
-             /* The AUTO and REGISTER classes should probably
-              * also become generic pointers, but I haven't yet
-              * devised a test case for that.
-              */
-             DCL_TYPE (val->type) = port->unqualified_pointer;
-             break;
-           }
-           if (options.model==MODEL_LARGE) {
-             DCL_TYPE (val->type) = FPOINTER;
-             break;
-           }
-#endif
          }
          break;
        case S_AUTO: