Skip to content

Commit

Permalink
Don't generate unused warnings for unused constants
Browse files Browse the repository at this point in the history
  • Loading branch information
graphitemaster committed Nov 19, 2016
1 parent 0b94d75 commit 6938567
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parser.cpp
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6938567

Please sign in to comment.