From: johanknol Date: Wed, 19 Sep 2001 10:56:05 +0000 (+0000) Subject: removed a fruitless attempt, compareType() should take care of this X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=bbf69f07912c6282f3aaac17e2fec30b12b728e4;p=fw%2Fsdcc removed a fruitless attempt, compareType() should take care of this git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1286 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCast.c b/src/SDCCast.c index d782ea75..4d5c02a3 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -610,7 +610,6 @@ processParms (ast * func, int *parmNumber, bool rightmost) { - int castError=0; sym_link *fetype = func->etype; /* if none of them exist */ @@ -746,35 +745,7 @@ processParms (ast * func, /* the parameter type must be at least castable */ - if (compareType (defParm->type, actParm->ftype) == 0) - { - castError++; - } - -#ifdef JWK20010916 - if (!IS_SPEC(defParm->type) && !IS_SPEC(actParm->ftype)) { - // now we have two pointers, check if they point to the same - sym_link *dtype=defParm->type, *atype=actParm->ftype; - do { - dtype=dtype->next; - atype=atype->next; - if ( - (dtype->next && !atype->next) || - (!dtype->next && atype->next) || - compareType (dtype, atype)!=1) { - castError++; - } - } while (dtype->next && atype->next); - if (IS_SPEC(dtype) && IS_SPEC(atype)) { - // ok so far, we have two etypes, they must have the same SCLASS - if (SPEC_SCLS(dtype)!=SPEC_SCLS(atype)) { - castError++; - } - } - } -#endif - - if (castError) { + if (compareType (defParm->type, actParm->ftype) == 0) { werror (W_INCOMPAT_CAST); fprintf (stderr, "type --> '"); printTypeChain (actParm->ftype, stderr); diff --git a/src/SDCCglue.c b/src/SDCCglue.c index b75c37ba..c86f5843 100644 --- a/src/SDCCglue.c +++ b/src/SDCCglue.c @@ -377,7 +377,7 @@ initPointer (initList * ilist) } wrong: werror (W_INIT_WRONG); - return NULL; + return constVal("0"); } diff --git a/src/SDCCmem.c b/src/SDCCmem.c index e5f13fa4..4692be48 100644 --- a/src/SDCCmem.c +++ b/src/SDCCmem.c @@ -581,13 +581,6 @@ allocLocal (symbol * sym) /* this is automatic */ -#ifdef JWK20010916 - if (!IS_SPEC(sym->type) && SPEC_OCLS(sym->etype)) { - allocIntoSeg (sym); - return; - } -#endif - /* if it to be placed on the stack */ if (options.stackAuto || reentrant) { sym->onStack = 1;