1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-28 19:29:53 +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 */
Entry->Flags |= Flags;