1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 02:29:52 +00:00

Issue an error for duplicate global variables.

Previously it was an assembler error.
This commit is contained in:
Piotr Fusik 2017-02-13 21:10:21 +01:00
parent 730d01a25f
commit 31f19fbc65

View File

@ -188,6 +188,10 @@ static void Parse (void)
if (CurTok.Tok == TOK_ASSIGN) {
/* This is a definition */
if (SymIsDef (Entry)) {
Error ("Global variable `%s' has already been defined",
Entry->Name);
}
Entry->Flags |= SC_DEF;
/* We cannot initialize types of unknown size, or