1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

Improved error message on initializing extern variables inside functions.

This commit is contained in:
acqn 2020-08-09 06:25:36 +08:00 committed by Oliver Schmidt
parent b62b1650f5
commit bde5be6793

View File

@ -493,7 +493,10 @@ static void ParseOneDecl (const DeclSpec* Spec)
if ((Decl.StorageClass & SC_EXTERN) == SC_EXTERN) {
/* External identifier - may not get initialized */
if (CurTok.Tok == TOK_ASSIGN) {
Error ("Cannot initialize externals");
Error ("Cannot initialize extern variable '%s'", Decl.Ident);
/* Avoid excess errors */
NextToken ();
ParseInit (Decl.Type);
}
}