From: MaartenBrock Date: Tue, 12 Feb 2008 15:09:16 +0000 (+0000) Subject: * src/SDCCsymt.c (compareType): fixed bug 1309013 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=630ef323d03f06cad446dde5413c13185b0d7d54;hp=c6fc407e1e4bf2a52848dd924a9b10d6200874ec;p=fw%2Fsdcc * src/SDCCsymt.c (compareType): fixed bug 1309013 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5004 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index a2e75c5e..890f06f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-02-12 Maarten Brock + + * src/SDCCsymt.c (compareType): fixed bug 1309013 + 2008-02-09 Borut Razem * src/SDCCval.c, src/SDCCval.h: diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 75568357..e950c580 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -2071,7 +2071,15 @@ compareType (sym_link * dest, sym_link * src) return -1; if (IS_FUNC (dest->next) && IS_VOID(src->next)) return -1; - return compareType (dest->next, src->next); + if (IS_VOID (src->next) && IS_VOID (dest->next)) + return 1; + if ((IS_VOID (src->next) && !IS_VOID (dest->next)) || + (!IS_VOID (src->next) && IS_VOID (dest->next)) ) + return -1; + if (compareType (dest->next, src->next) == 1) + return 1; + else + return 0; } if (DCL_TYPE (src) == DCL_TYPE (dest)) @@ -2080,7 +2088,15 @@ compareType (sym_link * dest, sym_link * src) { //checkFunction(src,dest); } - return compareType (dest->next, src->next); + if (IS_VOID (src->next) && IS_VOID (dest->next)) + return 1; + if ((IS_VOID (src->next) && !IS_VOID (dest->next)) || + (!IS_VOID (src->next) && IS_VOID (dest->next)) ) + return -1; + if (compareType (dest->next, src->next) == 1) + return 1; + else + return 0; } if (IS_PTR (dest) && IS_GENPTR (src) && IS_VOID(src->next)) {