From: Greg King Date: Sun, 9 Aug 2015 10:27:05 +0000 (-0400) Subject: Stopped extern declarations from changing previous static, but otherwise identical... X-Git-Tag: V2.16~239^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4e9842ef33789dae702302509d6c6b8d0acccb13;p=cc65 Stopped extern declarations from changing previous static, but otherwise identical, declarations. --- diff --git a/src/cc65/symtab.c b/src/cc65/symtab.c index 1f63e9430..0e4de4ea2 100644 --- a/src/cc65/symtab.c +++ b/src/cc65/symtab.c @@ -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;