mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-23 20:33:05 +00:00
-Weffectless-statement now also triggers on effectless incrementors in for-loops, if an incrementor was specified
This commit is contained in:
parent
3f1cad18af
commit
cb604603ca
1 changed files with 7 additions and 0 deletions
7
parser.c
7
parser.c
|
@ -1622,6 +1622,13 @@ static bool parser_parse_for(parser_t *parser, ast_block *block, ast_expression
|
|||
increment = parser_expression_leave(parser, false);
|
||||
if (!increment)
|
||||
goto onerr;
|
||||
if (!ast_istype(increment, ast_store) &&
|
||||
!ast_istype(increment, ast_call) &&
|
||||
!ast_istype(increment, ast_binstore))
|
||||
{
|
||||
if (parsewarning(parser, WARN_EFFECTLESS_STATEMENT, "statement has no effect"))
|
||||
goto onerr;
|
||||
}
|
||||
}
|
||||
|
||||
/* closing paren */
|
||||
|
|
Loading…
Reference in a new issue