Mesa (master): spirv: fix warning in release build

Ian Romanick idr at kemper.freedesktop.org
Mon Apr 25 10:24:06 UTC 2016


Module: Mesa
Branch: master
Commit: 29d2c0e9e6c545e5182c8da83ef4ca4a27d77388
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=29d2c0e9e6c545e5182c8da83ef4ca4a27d77388

Author: Grazvydas Ignotas <notasas at gmail.com>
Date:   Sat Apr 16 04:00:13 2016 +0300

spirv: fix warning in release build

Mark variable MAYBE_UNUSED to avoid unused-but-set-variable warning in
release build.

Signed-off-by: Grazvydas Ignotas <notasas at gmail.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

---

 src/compiler/spirv/vtn_cfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
index 6a43ef8..d9096f4 100644
--- a/src/compiler/spirv/vtn_cfg.c
+++ b/src/compiler/spirv/vtn_cfg.c
@@ -36,7 +36,7 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, SpvOp opcode,
       list_inithead(&b->func->body);
       b->func->control = w[3];
 
-      const struct glsl_type *result_type =
+      MAYBE_UNUSED const struct glsl_type *result_type =
          vtn_value(b, w[1], vtn_value_type_type)->type->type;
       struct vtn_value *val = vtn_push_value(b, w[2], vtn_value_type_function);
       val->func = b->func;




More information about the mesa-commit mailing list