From 89acceda60efd52c126bf91babd83974a515ce83 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 26 Jan 2021 14:04:14 -0500 Subject: [PATCH] glsl: Silence some warnings at -Og MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ./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 Part-of: --- src/compiler/glsl/link_uniforms.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp index 6518ec10f34..f0e229526f6 100644 --- a/src/compiler/glsl/link_uniforms.cpp +++ b/src/compiler/glsl/link_uniforms.cpp @@ -1039,7 +1039,7 @@ private: assert(!type->without_array()->is_interface()); assert(!(type->is_array() && type->fields.array->is_array())); - unsigned id; + unsigned id = 0; bool found = this->map->get(id, name); assert(found);