From 4742ee9123ee54c65c83a4e531b7ef83bafeeddd Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Tue, 2 Oct 2012 15:35:43 +0200 Subject: [PATCH] don't warn about unused end_sys_{globals,fields} --- parser.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/parser.c b/parser.c index f11684b..080bbc2 100644 --- 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);