From: Dale Weiler Date: Sat, 19 Nov 2016 11:46:32 +0000 (+0000) Subject: Don't generate unused warnings for unused constants X-Git-Tag: xonotic-v0.8.5~56 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6938567c6cc44cd8e526278f75de3e3b1863133f;p=xonotic%2Fgmqcc.git Don't generate unused warnings for unused constants --- diff --git a/parser.cpp b/parser.cpp index dbf70f4..004d374 100644 --- a/parser.cpp +++ b/parser.cpp @@ -6226,7 +6226,7 @@ bool parser_finish(parser_t *parser, const char *output) if (!ast_istype(it, ast_value)) continue; asvalue = (ast_value*)it; - if (!asvalue->m_uses && asvalue->m_vtype != TYPE_FUNCTION) { + if (!asvalue->m_uses && asvalue->m_cvq != CV_CONST && asvalue->m_vtype != TYPE_FUNCTION) { retval = retval && !compile_warning(asvalue->m_context, WARN_UNUSED_VARIABLE, "unused global: `%s`", asvalue->m_name); }