From: johanknol Date: Thu, 13 Mar 2003 19:36:56 +0000 (+0000) Subject: a function returning a constant pointer shouldn't be forced to code X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=3aaea86ff1d81cbb0432170e66afe22222fd9614;p=fw%2Fsdcc a function returning a constant pointer shouldn't be forced to code git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2387 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 0dce6fa4..7e5e40a5 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -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: