git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1135
4a8a32a2-be11-0410-ad9d-
d568d2c75423
{
symbol *sym = symHead;
symbol *csym = NULL;
{
symbol *sym = symHead;
symbol *csym = NULL;
for (; sym != NULL; sym = sym->next)
for (; sym != NULL; sym = sym->next)
changePointer(sym);
/* if already exists in the symbol table then check if
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)
{
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 */
/* do types match ? */
if (compareType (csym->type, sym->type) != 1)
/* no then error */
/* delete current entry */
deleteSym (SymbolTab, csym, csym->name);
/* 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);
}
/* add new entry */
addSym (SymbolTab, sym, sym->name, sym->level, sym->block, 1);
}