1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-02 04:41:35 +00:00

omit an error message also when an unresolved import was added by the compiler. fixes bug #1551

This commit is contained in:
mrdudz 2022-07-14 22:54:18 +02:00
parent a6b807b1d8
commit 7165b29809

View File

@ -776,8 +776,13 @@ static void PrintUnresolved (ExpCheckFunc F, void* Data)
Import* Imp = E->ImpList;
const char* name = GetString (E->Name);
while (Imp) {
unsigned J;
for (J = 0; J < CollCount (&Imp->RefLines); ++J) {
unsigned J, count = CollCount (&Imp->RefLines);
/* The count is 0 when the import was not added by an input file,
but by the compiler itself. */
if (count == 0) {
fprintf (stderr, "Error: Unresolved external '%s'\n", name);
} else {
for (J = 0; J < count; ++J) {
const LineInfo* LI = CollConstAt (&Imp->RefLines, J);
fprintf (stderr,
"%s:%u: Error: Unresolved external '%s'\n",
@ -785,6 +790,7 @@ static void PrintUnresolved (ExpCheckFunc F, void* Data)
GetSourceLine (LI),
name);
}
}
Imp = Imp->Next;
}
}