don't warn about unused end_sys_{globals,fields}

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-10-02 15:35:43 +02:00
parent 984d8e7adc
commit 4742ee9123

View file

@ -2928,8 +2928,12 @@ bool parser_finish(const char *output)
continue; continue;
asvalue = (ast_value*)(parser->globals[i].var); asvalue = (ast_value*)(parser->globals[i].var);
if (!asvalue->uses && !asvalue->isconst && asvalue->expression.vtype != TYPE_FUNCTION) { if (!asvalue->uses && !asvalue->isconst && asvalue->expression.vtype != TYPE_FUNCTION) {
retval = retval && !genwarning(ast_ctx(asvalue), WARN_UNUSED_VARIABLE, if (strcmp(asvalue->name, "end_sys_globals") &&
"unused global: `%s`", asvalue->name); 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)) { if (!ast_global_codegen(asvalue, ir)) {
printf("failed to generate global %s\n", parser->globals[i].name); printf("failed to generate global %s\n", parser->globals[i].name);