1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 06:31:31 +00:00

Stopped extern declarations from changing previous static, but otherwise identical, declarations.

This commit is contained in:
Greg King 2015-08-09 06:27:05 -04:00
parent d36f31dcff
commit 4e9842ef33

View File

@ -813,6 +813,11 @@ SymEntry* AddGlobalSym (const char* Name, const Type* T, unsigned Flags)
} }
} }
/* An extern declaration must not change the current linkage. */
if (IsFunc || (Flags & (SC_EXTERN | SC_DEF)) == SC_EXTERN) {
Flags &= ~SC_EXTERN;
}
/* Add the new flags */ /* Add the new flags */
Entry->Flags |= Flags; Entry->Flags |= Flags;