On 08/18/2016 04:25 AM, Emil Velikov wrote:
On 17 August 2016 at 15:39, Brian Paul <bri...@vmware.com> wrote:
We need an extra set of braces for an array inside a struct.
---
  src/compiler/glsl/ast_to_hir.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index e03a6e3..abab932 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -4731,7 +4731,7 @@ ast_declarator_list::hir(exec_list *instructions,
        if ((var->data.mode == ir_var_auto || var->data.mode == 
ir_var_temporary)
            && (var->type->is_numeric() || var->type->is_boolean())
            && state->zero_init) {
-         const ir_constant_data data = {0};
+         const ir_constant_data data = {{0}};
Different versions of GCC trigger warning on each one of these. The
former is the correct one according to the spec, yet memset is the
most robust (warnings free) option.

Humble suggestion: opt to the latter or expect someone to unknowingly
revert this.

I'll just let it go then.

-Brian


_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to