From: johanknol Date: Fri, 2 Nov 2001 13:41:59 +0000 (+0000) Subject: a better fix for bug #476632 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=59e3f92db9845355e57f38aa85a345bae32fc8e8;p=fw%2Fsdcc a better fix for bug #476632 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1489 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 35b18b01..7056cf7e 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -115,11 +115,21 @@ addSym (bucket ** stab, bucket *bp; /* temp bucket * */ if (checkType) { + symbol *csym = (symbol *)sym; + if (getenv("DEBUG_SANITY")) { fprintf (stderr, "addSym: %s ", sname); } /* make sure the type is complete and sane */ - checkTypeSanity(((symbol *)sym)->etype, ((symbol *)sym)->name); + checkTypeSanity(csym->etype, csym->name); + + // jwk: if this is a function ptr with a void arg, remove it + if (IS_DECL(csym->type) && DCL_TYPE(csym->type)==CPOINTER) { + sym_link *type=csym->type->next; + if (FUNC_ARGS(type) && SPEC_NOUN(FUNC_ARGS(type)->type)==V_VOID) { + FUNC_ARGS(type)=NULL; + } + } } /* prevent overflow of the (r)name buffers */ @@ -1766,11 +1776,6 @@ processFuncArgs (symbol * func, int ignoreName) int pNum = 1; sym_link *funcType=func->type; - // if this is a pointer to a function - if (DCL_TYPE(funcType)==CPOINTER) { - funcType=funcType->next; - } - /* if this function has variable argument list */ /* then make the function a reentrant one */ if (IFFUNC_HASVARARGS(funcType)) @@ -1810,11 +1815,6 @@ processFuncArgs (symbol * func, int ignoreName) aggregateToPointer (val); } - // jwk: this should not be here - if (IS_CODEPTR(val->type) && IS_FUNC(val->type->next)) { - processFuncArgs (val->sym, ignoreName); - } - val = val->next; pNum++; }