mirror of
https://github.com/cc65/cc65.git
synced 2025-08-10 04:25:21 +00:00
NoCodeConstExpr() fix to avoid exessive error messages.
This commit is contained in:
@@ -4211,7 +4211,8 @@ ExprDesc NoCodeConstExpr (void (*Func) (ExprDesc*))
|
|||||||
if (!ED_IsConst (&Expr) || !ED_CodeRangeIsEmpty (&Expr)) {
|
if (!ED_IsConst (&Expr) || !ED_CodeRangeIsEmpty (&Expr)) {
|
||||||
Error ("Constant expression expected");
|
Error ("Constant expression expected");
|
||||||
/* To avoid any compiler errors, make the expression a valid const */
|
/* To avoid any compiler errors, make the expression a valid const */
|
||||||
ED_MakeConstAbsInt (&Expr, 1);
|
Expr.Flags &= E_MASK_RTYPE | E_MASK_KEEP_RESULT;
|
||||||
|
Expr.Flags |= E_LOC_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return by value */
|
/* Return by value */
|
||||||
|
Reference in New Issue
Block a user