Add a --warnings-as-errors to cl65.

This commit is contained in:
Kugel Fuhr
2025-07-10 21:41:53 +02:00
parent c2f17b6f6b
commit 2e4c18770b
6 changed files with 81 additions and 66 deletions

View File

@@ -898,7 +898,8 @@ static void Usage (void)
" --version\t\t\tPrint the version number\n"
" --verbose\t\t\tVerbose mode\n"
" --zeropage-label name\t\tDefine and export a ZEROPAGE segment label\n"
" --zeropage-name seg\t\tSet the name of the ZEROPAGE segment\n",
" --zeropage-name seg\t\tSet the name of the ZEROPAGE segment\n"
" --warnings-as-errors\t\tTreat warnings as errors\n",
ProgName);
}
@@ -1435,6 +1436,16 @@ static void OptZeropageName (const char* Opt attribute ((unused)), const char* A
static void OptWarningsAsErrors (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Handle the --warnings-as-errors option */
{
CmdAddArg (&CA65, "--warnings-as-errors");
CmdAddArg (&LD65, "--warnings-as-errors");
}
int main (int argc, char* argv [])
/* Utility main program */
{
@@ -1494,6 +1505,7 @@ int main (int argc, char* argv [])
{ "--version", 0, OptVersion },
{ "--zeropage-label", 1, OptZeropageLabel },
{ "--zeropage-name", 1, OptZeropageName },
{ "--warnings-as-errors", 0, OptWarningsAsErrors },
};
char* CmdPath;

View File

@@ -642,13 +642,11 @@ void PrintDbgSegments (FILE* F)
fprintf (F, ",oname=\"%s\",ooffs=%lu",
S->OutputName, S->OutputOffs);
}
if (S->MemArea) {
if (S->MemArea->BankExpr) {
if (S->MemArea && S->MemArea->BankExpr) {
if (IsConstExpr (S->MemArea->BankExpr)) {
fprintf (F, ",bank=%lu", GetExprVal (S->MemArea->BankExpr));
}
}
}
fputc ('\n', F);
}
}

View File

@@ -120,6 +120,8 @@ void XexSetRunAd (XexDesc* D, Import *RunAd)
D->RunAd = RunAd;
}
XexInitAd* XexSearchInitMem (XexDesc* D, MemoryArea *InitMem)
{
XexInitAd* I;
@@ -132,6 +134,7 @@ XexInitAd* XexSearchInitMem(XexDesc* D, MemoryArea *InitMem)
}
int XexAddInitAd (XexDesc* D, MemoryArea *InitMem, Import *InitAd)
/* Sets and INITAD for the given memory area */
{
@@ -149,6 +152,8 @@ int XexAddInitAd (XexDesc* D, MemoryArea *InitMem, Import *InitAd)
return 0;
}
static unsigned XexWriteExpr (ExprNode* E, int Signed, unsigned Size,
unsigned long Offs attribute ((unused)),
void* Data)