1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-14 16:33:00 +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 1dae5062e9
commit 36315ecc06

View File

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