mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
Declarations of 'extern' object and function should be visible in the file scope.
This commit is contained in:
parent
a040c28cc4
commit
a1992702f8
@ -1159,12 +1159,13 @@ SymEntry* AddLocalSym (const char* Name, const Type* T, unsigned Flags, int Offs
|
||||
SymEntry* AddGlobalSym (const char* Name, const Type* T, unsigned Flags)
|
||||
/* Add an external or global symbol to the symbol table and return the entry */
|
||||
{
|
||||
/* Use the global symbol table */
|
||||
/* Start from the local symbol table */
|
||||
SymTable* Tab = SymTab;
|
||||
|
||||
/* Do we have an entry with this name already? */
|
||||
SymEntry* Entry = FindSymInTree (Tab, Name);
|
||||
if (Entry) {
|
||||
|
||||
/* We have a symbol with this name already */
|
||||
if (HandleSymRedefinition (Entry, T, Flags)) {
|
||||
Entry = 0;
|
||||
@ -1215,7 +1216,11 @@ SymEntry* AddGlobalSym (const char* Name, const Type* T, unsigned Flags)
|
||||
/* Use the fail-safe table for fictitious symbols */
|
||||
Tab = FailSafeTab;
|
||||
}
|
||||
}
|
||||
|
||||
} else if ((Flags & (SC_EXTERN | SC_FUNC)) != 0) {
|
||||
/* Add the new declaration to the global symbol table instead */
|
||||
Tab = SymTab0;
|
||||
}
|
||||
|
||||
if (Entry == 0 || Entry->Owner != Tab) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user