X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=ir.cpp;h=c71cad8624e7e055d2a3b7e6203b9061b2656fbb;hp=d6a54932473b0e5df5f163ed4b8c82d6b457cbcd;hb=def1a26b12ffdec8f8e09fb9c41459ad30f573d3;hpb=eab20602b1a11b9f989a8d73460e3ccfb7c173e9;ds=sidebyside diff --git a/ir.cpp b/ir.cpp index d6a5493..c71cad8 100644 --- a/ir.cpp +++ b/ir.cpp @@ -651,13 +651,14 @@ bool ir_function_finalize(ir_function *self) // individual components are unused so mention them for (size_t i = 0; i < 3; i++) if ((bits & (1 << i)) - && irwarning(v->m_context, WARN_UNUSED_VARIABLE, - "unused variable: `%s.%c`", v->m_name.c_str(), "xyz"[i])) + && irwarning(v->m_context, WARN_UNUSED_COMPONENT, + "unused vector component: `%s.%c`", v->m_name.c_str(), "xyz"[i])) return false; } // just a standard variable - else if (irwarning(v->m_context, WARN_UNUSED_VARIABLE, - "unused variable: `%s`", v->m_name.c_str())) return false; + else if (v->m_name[0] != '#' + && irwarning(v->m_context, WARN_UNUSED_VARIABLE, + "unused variable: `%s`", v->m_name.c_str())) return false; } }