From: Dale Weiler Date: Sat, 19 Nov 2016 10:05:58 +0000 (+0000) Subject: Unused globals even if they have an initial value should produce unused diagnostic X-Git-Tag: xonotic-v0.8.5~60 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=eca4e2c3092f902809539b6ed5c9b681006fe771;p=xonotic%2Fgmqcc.git Unused globals even if they have an initial value should produce unused diagnostic --- diff --git a/parser.cpp b/parser.cpp index 51f7e1e..dbf70f4 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_hasvalue && asvalue->m_vtype != TYPE_FUNCTION) { + if (!asvalue->m_uses && asvalue->m_vtype != TYPE_FUNCTION) { retval = retval && !compile_warning(asvalue->m_context, WARN_UNUSED_VARIABLE, "unused global: `%s`", asvalue->m_name); }