- #if 0
- /* If only one of the definitions used the "at" keyword, copy */
- /* the address to the other. */
- if (IS_SPEC(csym->etype) && SPEC_ABSA(csym->etype)
- && IS_SPEC(sym->etype) && !SPEC_ABSA(sym->etype))
- {
- SPEC_ABSA (sym->etype) = 1;
- SPEC_ADDR (sym->etype) = SPEC_ADDR (csym->etype);
- }
- if (IS_SPEC(csym->etype) && !SPEC_ABSA(csym->etype)
- && IS_SPEC(sym->etype) && SPEC_ABSA(sym->etype))
- {
- SPEC_ABSA (csym->etype) = 1;
- SPEC_ADDR (csym->etype) = SPEC_ADDR (sym->etype);
- }
- #endif
-
- error = 0;
- if (csym->ival && sym->ival)
- error = 1;
- if (compareTypeExact (csym->type, sym->type, sym->level) != 1)
- error = 1;
-
- if (error) {
- /* one definition extern ? */
- if (IS_EXTERN (csym->etype) || IS_EXTERN (sym->etype))
- werror (E_EXTERN_MISMATCH, sym->name);
- else
- werror (E_DUPLICATE, sym->name);
- werrorfl (csym->fileDef, csym->lineDef, E_PREVIOUS_DEF);
- #if 0
- fprintf (stderr, "from type '");
- printTypeChain (csym->type, stderr);
- if (IS_SPEC (csym->etype) && SPEC_ABSA (csym->etype))
- fprintf(stderr, " at 0x%x", SPEC_ADDR (csym->etype));
- fprintf (stderr, "'\nto type '");
- printTypeChain (sym->type, stderr);
- if (IS_SPEC (sym->etype) && SPEC_ABSA (sym->etype))
- fprintf(stderr, " at 0x%x", SPEC_ADDR (sym->etype));
- fprintf (stderr, "'\n");
- #endif
- continue;
+ error = 0;
+ if (csym->ival && sym->ival)
+ error = 1;
+ if (compareTypeExact (csym->type, sym->type, sym->level) != 1)
+ error = 1;
+ }
+
+ if (error)
+ {
+ /* one definition extern ? */
+ if (IS_EXTERN (csym->etype) || IS_EXTERN (sym->etype))
+ werror (E_EXTERN_MISMATCH, sym->name);
+ else
+ werror (E_DUPLICATE, sym->name);
+ werrorfl (csym->fileDef, csym->lineDef, E_PREVIOUS_DEF);
+ #if 0
+ fprintf (stderr, "from type '");
+ printTypeChain (csym->type, stderr);
+ if (IS_SPEC (csym->etype) && SPEC_ABSA (csym->etype))
+ fprintf(stderr, " at 0x%x", SPEC_ADDR (csym->etype));
+ fprintf (stderr, "'\nto type '");
+ printTypeChain (sym->type, stderr);
+ if (IS_SPEC (sym->etype) && SPEC_ABSA (sym->etype))
+ fprintf(stderr, " at 0x%x", SPEC_ADDR (sym->etype));
+ fprintf (stderr, "'\n");
+ #endif
+ continue;
+ }
+
+ if (csym->ival && !sym->ival)
+ sym->ival = csym->ival;
+
+ if (!csym->cdef && !sym->cdef && IS_EXTERN (sym->etype))
+ {
+ /* if none of symbols is a compiler defined function
+ and at least one is not extern
+ then set the new symbol to non extern */
+ SPEC_EXTR(sym->etype) = SPEC_EXTR(csym->etype);
+ }
+
+ /* delete current entry */
+ deleteSym (SymbolTab, csym, csym->name);
+ deleteFromSeg(csym);
+
+ symPtrPtr = symHead;
+ while (*symPtrPtr && *symPtrPtr != csym)
+ symPtrPtr = &(*symPtrPtr)->next;
+ if (*symPtrPtr == csym)
+ *symPtrPtr = csym->next;