[Mesa-dev] [PATCH 09/10] glsl: fix new gcc6 warnings

Ian Romanick idr at freedesktop.org
Tue Feb 16 19:03:23 UTC 2016


This patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

On 02/16/2016 10:58 AM, Rob Clark wrote:
> 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 at gmail.com>
> ---
>  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 b639378..9b08d25 100644
> --- a/src/compiler/glsl/ast_to_hir.cpp
> +++ b/src/compiler/glsl/ast_to_hir.cpp
> @@ -6259,7 +6259,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) {
> 



More information about the mesa-dev mailing list