From: Piotr Fusik Date: Mon, 13 Feb 2017 20:10:21 +0000 (+0100) Subject: Issue an error for duplicate global variables. X-Git-Tag: V2.16~29^2~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=31f19fbc6579a57186cc44e06e8494a34b9de057;p=cc65 Issue an error for duplicate global variables. Previously it was an assembler error. --- diff --git a/src/cc65/compile.c b/src/cc65/compile.c index 85a2e9939..9cdeaf7e5 100644 --- a/src/cc65/compile.c +++ b/src/cc65/compile.c @@ -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