]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Unused globals even if they have an initial value should produce unused diagnostic
authorDale Weiler <weilercdale@gmail.com>
Sat, 19 Nov 2016 10:05:58 +0000 (10:05 +0000)
committerDale Weiler <weilercdale@gmail.com>
Sat, 19 Nov 2016 10:05:58 +0000 (10:05 +0000)
parser.cpp

index 51f7e1ea6c571d20b158953b803b306f52f1c35d..dbf70f4a9a8ff2bbe94525ee2e97940b7db5efeb 100644 (file)
@@ -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);
         }