Fixed diagnostic messages about undeclared identifiers.

This commit is contained in:
acqn 2023-11-27 20:39:15 +08:00
parent 7574e36e95
commit b99ebc1256
4 changed files with 4 additions and 4 deletions

View File

@ -102,7 +102,7 @@ static SymEntry* AsmGetSym (unsigned Arg, unsigned Type)
/* Did we find a symbol with this name? */
if (Sym == 0) {
Error ("Undefined symbol '%s' for argument %u", CurTok.Ident, Arg);
Error ("Undeclared symbol '%s' for argument %u", CurTok.Ident, Arg);
AsmErrorSkip ();
return 0;
}

View File

@ -1322,10 +1322,10 @@ static void Primary (ExprDesc* E)
E->Name = (uintptr_t) Sym->Name;
} else {
/* Undeclared Variable */
Error ("Undeclared identifier '%s'", Ident);
Sym = AddLocalSym (Ident, type_int, SC_AUTO | SC_REF, 0);
E->Flags = E_LOC_STACK | E_RTYPE_LVAL;
E->Type = type_int;
Error ("Undefined symbol: '%s'", Ident);
}
}

View File

@ -1484,7 +1484,7 @@ void MakeZPSym (const char* Name)
if (Entry) {
Entry->Flags |= SC_ZEROPAGE;
} else {
Error ("Undefined symbol: '%s'", Name);
Error ("Undeclared symbol: '%s'", Name);
}
}

View File

@ -1,5 +1,5 @@
custom-reference-error.c:18: Error: Call to undeclared function 'printf'
custom-reference-error.c:19: Error: Undefined symbol: 'n'
custom-reference-error.c:19: Error: Undeclared identifier 'n'
custom-reference-error.c:21: Warning: Control reaches end of non-void function [-Wreturn-type]
custom-reference-error.c:21: Warning: Parameter 'argc' is never used
custom-reference-error.c:21: Warning: Parameter 'argv' is never used