mirror of
https://github.com/cc65/cc65.git
synced 2025-01-10 19:29:45 +00:00
No "Statement has no effect" warnings on statements with errors.
This commit is contained in:
parent
7e68a24625
commit
11a5f0edf1
@ -581,6 +581,7 @@ int Statement (int* PendingToken)
|
||||
ExprDesc Expr;
|
||||
int GotBreak;
|
||||
CodeMark Start, End;
|
||||
unsigned PrevErrorCount = ErrorCount;
|
||||
|
||||
/* Assume no pending token */
|
||||
if (PendingToken) {
|
||||
@ -681,7 +682,8 @@ int Statement (int* PendingToken)
|
||||
GetCodePos (&End);
|
||||
if (CodeRangeIsEmpty (&Start, &End) &&
|
||||
!IsTypeVoid (Expr.Type) &&
|
||||
IS_Get (&WarnNoEffect)) {
|
||||
IS_Get (&WarnNoEffect) &&
|
||||
PrevErrorCount == ErrorCount) {
|
||||
Warning ("Statement has no effect");
|
||||
}
|
||||
CheckSemi (PendingToken);
|
||||
|
Loading…
x
Reference in New Issue
Block a user