[Mesa-dev] [PATCH 3/4] glsl ast_to_hir: Silence uninitialized variable warnings in the release build

Ian Romanick idr at freedesktop.org
Mon Jun 24 13:33:31 PDT 2013


On 06/22/2013 08:43 AM, Emil Velikov wrote:
> Resolves the following gcc warnings
>
>   warning: 'iface_type_name' may be used uninitialized in this function
>   warning: 'var_mode' may be used uninitialized in this function
>
> Note: The variables are initialised to UNKNOWN and ir_var_auto
>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>

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

> ---
>   src/glsl/ast_to_hir.cpp | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
> index e918ade..a3d820f 100644
> --- a/src/glsl/ast_to_hir.cpp
> +++ b/src/glsl/ast_to_hir.cpp
> @@ -4174,6 +4174,8 @@ ast_interface_block::hir(exec_list *instructions,
>         var_mode = ir_var_uniform;
>         iface_type_name = "uniform";
>      } else {
> +      var_mode = ir_var_auto;
> +      iface_type_name = "UNKNOWN";
>         assert(!"interface block layout qualifier not found!");
>      }
>
>



More information about the mesa-dev mailing list