]> git.sur5r.net Git - cc65/commitdiff
Stopped extern declarations from changing previous static, but otherwise identical...
authorGreg King <gregdk@users.sf.net>
Sun, 9 Aug 2015 10:27:05 +0000 (06:27 -0400)
committerGreg King <gregdk@users.sf.net>
Sun, 9 Aug 2015 10:27:05 +0000 (06:27 -0400)
src/cc65/symtab.c

index 1f63e9430da997d511994f76b0bd3933ed5f514a..0e4de4ea2c2957e8661a69d52f5e85fc1ffbc08a 100644 (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;