From: johanknol Date: Fri, 10 Aug 2001 09:03:31 +0000 (+0000) Subject: fixed bug #449137 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=df7e46ea886a79136ee2f4d16db5967c61ef826b;p=fw%2Fsdcc fixed bug #449137 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1135 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 2037ea60..a6052bf9 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -943,6 +943,7 @@ addSymChain (symbol * symHead) { symbol *sym = symHead; symbol *csym = NULL; + int bothSymbolsExtern; for (; sym != NULL; sym = sym->next) @@ -950,16 +951,18 @@ addSymChain (symbol * symHead) changePointer(sym); /* if already exists in the symbol table then check if - the previous was an extern definition if yes then + one of them is an extern definition if yes then then check if the type match, if the types match then delete the current entry and add the new entry */ if ((csym = findSymWithLevel (SymbolTab, sym)) && csym->level == sym->level) { - /* previous definition extern ? */ - if (IS_EXTERN (csym->etype)) + /* one definition extern ? */ + if (IS_EXTERN (csym->etype) || IS_EXTERN (sym->etype)) { + bothSymbolsExtern= + IS_EXTERN (csym->etype) && IS_EXTERN (sym->etype); /* do types match ? */ if (compareType (csym->type, sym->type) != 1) /* no then error */ @@ -967,6 +970,10 @@ addSymChain (symbol * symHead) /* delete current entry */ deleteSym (SymbolTab, csym, csym->name); + + /* this isn't really needed, but alla */ + sym->etype->select.s._extern=bothSymbolsExtern; + /* add new entry */ addSym (SymbolTab, sym, sym->name, sym->level, sym->block, 1); }