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

@@ -1291,7 +1291,7 @@ static void ParseConDes (void)
AttrCheck (AttrFlags, atType, "TYPE");
/* Check if the condes has already attributes defined */
if (ConDesHasSegName(Type) || ConDesHasLabel(Type)) {
if (ConDesHasSegName (Type) || ConDesHasLabel (Type)) {
PError (&CfgErrorPos,
"`CONDES' attributes for type %d are already defined",
Type);

View File

@@ -313,7 +313,7 @@ static void OptCfgPath (const char* Opt attribute ((unused)), const char* Arg)
static void OptColor(const char* Opt, const char* Arg)
static void OptColor (const char* Opt, const char* Arg)
/* Handle the --color option */
{
ColorMode Mode = CP_Parse (Arg);
@@ -648,7 +648,7 @@ static void CmdlOptTarget (const char* Opt attribute ((unused)), const char* Arg
static void ParseCommandLine(void)
static void ParseCommandLine (void)
{
/* Program long options */
static const LongOpt OptTab[] = {
@@ -886,7 +886,7 @@ int main (int argc, char* argv [])
}
if (WarningCount > 0 && WarningsAsErrors) {
Error("Warnings as errors");
Error ("Warnings as errors");
}
/* Create the output file */

View File

@@ -493,7 +493,7 @@ void CfgSpecialToken (const IdentTok* Table, unsigned Size, const char* Name)
SB_Done (&Note);
}
PError (&CfgErrorPos, "%s expected but got `%s'", Name,
SB_GetConstBuf(&CfgSVal));
SB_GetConstBuf (&CfgSVal));
return;
}

View File

@@ -642,11 +642,9 @@ void PrintDbgSegments (FILE* F)
fprintf (F, ",oname=\"%s\",ooffs=%lu",
S->OutputName, S->OutputOffs);
}
if (S->MemArea) {
if (S->MemArea->BankExpr) {
if (IsConstExpr (S->MemArea->BankExpr)) {
fprintf (F, ",bank=%lu", GetExprVal(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,7 +120,9 @@ void XexSetRunAd (XexDesc* D, Import *RunAd)
D->RunAd = RunAd;
}
XexInitAd* XexSearchInitMem(XexDesc* D, MemoryArea *InitMem)
XexInitAd* XexSearchInitMem (XexDesc* D, MemoryArea *InitMem)
{
XexInitAd* I;
for (I=D->InitAds; I != 0; I=I->next)
@@ -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)