mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +00:00
don't warn about unused end_sys_{globals,fields}
This commit is contained in:
parent
984d8e7adc
commit
4742ee9123
1 changed files with 6 additions and 2 deletions
4
parser.c
4
parser.c
|
@ -2928,9 +2928,13 @@ 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) {
|
||||||
|
if (strcmp(asvalue->name, "end_sys_globals") &&
|
||||||
|
strcmp(asvalue->name, "end_sys_fields"))
|
||||||
|
{
|
||||||
retval = retval && !genwarning(ast_ctx(asvalue), WARN_UNUSED_VARIABLE,
|
retval = retval && !genwarning(ast_ctx(asvalue), WARN_UNUSED_VARIABLE,
|
||||||
"unused global: `%s`", asvalue->name);
|
"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);
|
||||||
ir_builder_delete(ir);
|
ir_builder_delete(ir);
|
||||||
|
|
Loading…
Reference in a new issue