Standard formatting of error messages.

https://www.gnu.org/prep/standards/html_node/Errors.html

Issue: https://github.com/cc65/cc65/issues/1494
This commit is contained in:
Andrea Odetti
2021-05-10 09:56:40 +01:00
committed by Oliver Schmidt
parent bda5bf70ce
commit bcc670ee36
9 changed files with 22 additions and 20 deletions

View File

@@ -140,12 +140,12 @@ void CheckAssertions (void)
case ASSERT_ACT_WARN:
case ASSERT_ACT_LDWARN:
Warning ("%s(%u): %s", Module, Line, Message);
Warning ("%s:%u: %s", Module, Line, Message);
break;
case ASSERT_ACT_ERROR:
case ASSERT_ACT_LDERROR:
Error ("%s(%u): %s", Module, Line, Message);
Error ("%s:%u: %s", Module, Line, Message);
break;
default:

View File

@@ -774,17 +774,19 @@ static void PrintUnresolved (ExpCheckFunc F, void* Data)
if (E->Expr == 0 && E->ImpCount > 0 && F (E->Name, Data) == 0) {
/* Unresolved external */
Import* Imp = E->ImpList;
const char * name = GetString (E->Name);
fprintf (stderr,
"Unresolved external '%s' referenced in:\n",
GetString (E->Name));
name);
while (Imp) {
unsigned J;
for (J = 0; J < CollCount (&Imp->RefLines); ++J) {
const LineInfo* LI = CollConstAt (&Imp->RefLines, J);
fprintf (stderr,
" %s(%u)\n",
" %s:%u: Error: Unresolved external '%s'\n",
GetSourceName (LI),
GetSourceLine (LI));
GetSourceLine (LI),
name);
}
Imp = Imp->Next;
}

View File

@@ -92,7 +92,7 @@ void CfgWarning (const FilePos* Pos, const char* Format, ...)
SB_VPrintf (&Buf, Format, ap);
va_end (ap);
Warning ("%s(%u): %s",
Warning ("%s:%u: %s",
GetString (Pos->Name), Pos->Line, SB_GetConstBuf (&Buf));
SB_Done (&Buf);
}
@@ -109,7 +109,7 @@ void CfgError (const FilePos* Pos, const char* Format, ...)
SB_VPrintf (&Buf, Format, ap);
va_end (ap);
Error ("%s(%u): %s",
Error ("%s:%u: %s",
GetString (Pos->Name), Pos->Line, SB_GetConstBuf (&Buf));
SB_Done (&Buf);
}