diff --git a/src/cc65/assignment.c b/src/cc65/assignment.c index 2adb1c20e..54ab28d4e 100644 --- a/src/cc65/assignment.c +++ b/src/cc65/assignment.c @@ -319,9 +319,9 @@ static void OpAssignBitField (const GenDesc* Gen, ExprDesc* Expr, const char* Op if (Expr2.IVal == 0) { /* Check for div by zero/mod by zero */ if (Gen->Func == g_div) { - Error ("Division by zero"); + Warning ("Division by zero"); } else if (Gen->Func == g_mod) { - Error ("Modulo operation with zero"); + Warning ("Modulo operation with zero"); } } else if (Gen->Func == g_asl || Gen->Func == g_asr) { const Type* CalType = IntPromotion (Expr->Type); @@ -528,9 +528,9 @@ static void OpAssignArithmetic (const GenDesc* Gen, ExprDesc* Expr, const char* if (Expr2.IVal == 0 && !ED_IsUneval (Expr)) { /* Check for div by zero/mod by zero */ if (Gen->Func == g_div) { - Error ("Division by zero"); + Warning ("Division by zero"); } else if (Gen->Func == g_mod) { - Error ("Modulo operation with zero"); + Warning ("Modulo operation with zero"); } } else if (Gen->Func == g_asl || Gen->Func == g_asr) { const Type* CalType = IntPromotion (Expr->Type); diff --git a/src/cc65/expr.c b/src/cc65/expr.c index 45dc9cc37..78a4c516a 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -2204,7 +2204,7 @@ static void hie_internal (const GenDesc* Ops, /* List of generators */ case TOK_DIV: if (Val2 == 0) { if (!ED_IsUneval (Expr)) { - Error ("Division by zero"); + Warning ("Division by zero"); } Expr->IVal = 0xFFFFFFFF; } else { @@ -2219,7 +2219,7 @@ static void hie_internal (const GenDesc* Ops, /* List of generators */ case TOK_MOD: if (Val2 == 0) { if (!ED_IsUneval (Expr)) { - Error ("Modulo operation with zero"); + Warning ("Modulo operation with zero"); } Expr->IVal = 0; } else { @@ -2291,9 +2291,9 @@ static void hie_internal (const GenDesc* Ops, /* List of generators */ rtype |= CF_CONST; if (Expr2.IVal == 0 && !ED_IsUneval (Expr)) { if (Tok == TOK_DIV) { - Error ("Division by zero"); + Warning ("Division by zero"); } else if (Tok == TOK_MOD) { - Error ("Modulo operation with zero"); + Warning ("Modulo operation with zero"); } } if ((Gen->Flags & GEN_NOPUSH) != 0) {