* src/SDCCsymt.c: reverted bad fixed of bug #1805702
[fw/sdcc] / src / SDCCsymt.c
index ab99e717b98978c45eb5bc8d5a5b49c8ce34b380..1e02f3cdf913f7409b77673229d4ceaadd09b495 100644 (file)
@@ -1082,10 +1082,11 @@ addSymChain (symbol ** symHead)
             DCL_ELEM (sym->type) = getNelements (sym->type, sym->ival);
         }
 
-      /* if already exists in the symbol table
-         then check if the type match;
-         if yes then if at least one is not extern
-         set the new symbol to non extern  */
+      /* if already exists in the symbol table then check if
+           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)
         {
@@ -1155,14 +1156,6 @@ addSymChain (symbol ** symHead)
           if (csym->ival && !sym->ival)
             sym->ival = csym->ival;
 
-          if (!sym->cdef && IS_EXTERN (sym->etype))
-            {
-              /* set the new symbol to not extern if not a compiler defined function
-                and at least one is non extern */
-              SPEC_EXTR(sym->etype) = SPEC_EXTR(csym->etype);
-              sym->cdef = csym->cdef;
-            }
-
           /* delete current entry */
           deleteSym (SymbolTab, csym, csym->name);
           deleteFromSeg(csym);