glsl: Silence some warnings at -Og
authorAdam Jackson <ajax@redhat.com>
Tue, 26 Jan 2021 19:04:14 +0000 (14:04 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 18 Feb 2021 20:59:43 +0000 (20:59 +0000)
commit89acceda60efd52c126bf91babd83974a515ce83
treeef85438b05b2f72b31f01712ebcc60914414473a
parent831eff15f8c3b613a7e532d938fec08533c71886
glsl: Silence some warnings at -Og

   ./src/compiler/glsl/link_uniforms.cpp: In member function ‘virtual void parcel_out_uniform_storage::visit_field(const glsl_type*, const char*, bool, const glsl_type*, glsl_interface_packing, bool)’:
   ../src/compiler/glsl/link_uniforms.cpp:1171:61: warning: ‘id’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    1171 |       calculate_array_size_and_stride(prog, &this->uniforms[id],

   ../src/compiler/glsl/link_uniform_initializers.cpp: In function ‘gl_uniform_storage* linker::get_storage(gl_shader_program*, const char*)’:
   ../src/compiler/glsl/link_uniform_initializers.cpp:41:42: warning: ‘id’ may be used uninitialized in this function [-Wmaybe-uninitialized]
      41 |       return &prog->data->UniformStorage[id];

Can't happen, but flow control apparently can't prove it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8724>
src/compiler/glsl/link_uniforms.cpp