Issue an error for duplicate global variables.
Previously it was an assembler error.
This commit is contained in:
@@ -188,6 +188,10 @@ static void Parse (void)
|
|||||||
if (CurTok.Tok == TOK_ASSIGN) {
|
if (CurTok.Tok == TOK_ASSIGN) {
|
||||||
|
|
||||||
/* This is a definition */
|
/* This is a definition */
|
||||||
|
if (SymIsDef (Entry)) {
|
||||||
|
Error ("Global variable `%s' has already been defined",
|
||||||
|
Entry->Name);
|
||||||
|
}
|
||||||
Entry->Flags |= SC_DEF;
|
Entry->Flags |= SC_DEF;
|
||||||
|
|
||||||
/* We cannot initialize types of unknown size, or
|
/* We cannot initialize types of unknown size, or
|
||||||
|
|||||||
Reference in New Issue
Block a user