]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
don't warn about unused end_sys_{globals,fields}
authorWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 2 Oct 2012 13:35:43 +0000 (15:35 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 2 Oct 2012 13:35:43 +0000 (15:35 +0200)
parser.c

index f11684bb3bb139325a598b8114374db641a0444b..080bbc2c092963b2248948b9fbf89d8f4081efaf 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -2928,8 +2928,12 @@ bool parser_finish(const char *output)
                 continue;
             asvalue = (ast_value*)(parser->globals[i].var);
             if (!asvalue->uses && !asvalue->isconst && asvalue->expression.vtype != TYPE_FUNCTION) {
-                retval = retval && !genwarning(ast_ctx(asvalue), WARN_UNUSED_VARIABLE,
-                                               "unused global: `%s`", asvalue->name);
+                if (strcmp(asvalue->name, "end_sys_globals") &&
+                    strcmp(asvalue->name, "end_sys_fields"))
+                {
+                    retval = retval && !genwarning(ast_ctx(asvalue), WARN_UNUSED_VARIABLE,
+                                                   "unused global: `%s`", asvalue->name);
+                }
             }
             if (!ast_global_codegen(asvalue, ir)) {
                 printf("failed to generate global %s\n", parser->globals[i].name);