Fix a warning

This commit is contained in:
Wolfgang Bumiller 2013-01-26 14:43:49 +01:00
parent b39b61e514
commit edfe340d09

View file

@ -2680,12 +2680,12 @@ static bool parse_for_go(parser_t *parser, ast_block *block, ast_expression **ou
/* parse the incrementor */ /* parse the incrementor */
if (parser->tok != ')') { if (parser->tok != ')') {
lex_ctx ctx = parser_ctx(parser); lex_ctx condctx = parser_ctx(parser);
increment = parse_expression_leave(parser, false, false, false); increment = parse_expression_leave(parser, false, false, false);
if (!increment) if (!increment)
goto onerr; goto onerr;
if (!ast_side_effects(increment)) { if (!ast_side_effects(increment)) {
if (compile_warning(ctx, WARN_EFFECTLESS_STATEMENT, "statement has no effect")) if (compile_warning(condctx, WARN_EFFECTLESS_STATEMENT, "statement has no effect"))
goto onerr; goto onerr;
} }
} }