]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
use the expression's linenumber for the 'statement has no effect' warning rather...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 23 Aug 2012 18:56:05 +0000 (20:56 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 23 Aug 2012 18:56:05 +0000 (20:56 +0200)
parser.c

index b9e2d82e62d18175c0e1f23369944bf7156cd31c..5bdb7e7cbeacb805b1bb66425f579809a6106a0e 100644 (file)
--- 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;