mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-24 04:41:25 +00:00
use the expression's linenumber for the 'statement has no effect' warning rather than the current one because that one's usually the line below...
This commit is contained in:
parent
cb604603ca
commit
41d1ef37d2
1 changed files with 2 additions and 2 deletions
4
parser.c
4
parser.c
|
@ -1626,7 +1626,7 @@ static bool parser_parse_for(parser_t *parser, ast_block *block, ast_expression
|
|||
!ast_istype(increment, ast_call) &&
|
||||
!ast_istype(increment, ast_binstore))
|
||||
{
|
||||
if (parsewarning(parser, WARN_EFFECTLESS_STATEMENT, "statement has no effect"))
|
||||
if (genwarning(ast_ctx(increment), WARN_EFFECTLESS_STATEMENT, "statement has no effect"))
|
||||
goto onerr;
|
||||
}
|
||||
}
|
||||
|
@ -1779,7 +1779,7 @@ static bool parser_parse_statement(parser_t *parser, ast_block *block, ast_expre
|
|||
!ast_istype(exp, ast_call) &&
|
||||
!ast_istype(exp, ast_binstore))
|
||||
{
|
||||
if (parsewarning(parser, WARN_EFFECTLESS_STATEMENT, "statement has no effect"))
|
||||
if (genwarning(ast_ctx(exp), WARN_EFFECTLESS_STATEMENT, "statement has no effect"))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue