From 41d1ef37d25a81d5cb25bc1523656d6305a2c244 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Thu, 23 Aug 2012 20:56:05 +0200 Subject: [PATCH] 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... --- parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parser.c b/parser.c index b9e2d82..5bdb7e7 100644 --- a/parser.c +++ b/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; -- 2.39.2