glsl: fix new gcc6 warnings
authorRob Clark <robdclark@gmail.com>
Tue, 16 Feb 2016 18:35:58 +0000 (13:35 -0500)
committerRob Clark <robclark@freedesktop.org>
Thu, 18 Feb 2016 22:10:55 +0000 (17:10 -0500)
src/compiler/glsl/ast_to_hir.cpp: In function ‘unsigned int ast_process_struct_or_iface_block_members(exec_list*, _mesa_glsl_parse_state*, exec_list*, glsl_struct_field**, bool, glsl_matrix_layout, bool, ir_variable_mode, ast_type_qualifier*,
unsigned int, unsigned int)’:
src/compiler/glsl/ast_to_hir.cpp:6339:52: warning: ‘first_member_has_explicit_location’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             if (!layout->flags.q.explicit_location &&
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
                 ((first_member_has_explicit_location &&
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                   !qual->flags.q.explicit_location) ||
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  (!first_member_has_explicit_location &&
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                   qual->flags.q.explicit_location))) {
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/glsl/ast_to_hir.cpp

index 36cdd3c981db2d35e5ff8094793e3ed57e1c3568..75abef6a8f936ae480d26b5f47e5d134aa32892f 100644 (file)
@@ -6267,7 +6267,7 @@ ast_process_struct_or_iface_block_members(exec_list *instructions,
                                                   decl_count);
 
    bool first_member = true;
-   bool first_member_has_explicit_location;
+   bool first_member_has_explicit_location = false;
 
    unsigned i = 0;
    foreach_list_typed (ast_declarator_list, decl_list, link, declarations) {