[Mesa-dev] [PATCH] i965: Silence GCC maybe-uninitialized warning.
Anuj Phogat
anuj.phogat at gmail.com
Mon Mar 9 08:27:26 PDT 2015
On Fri, Mar 6, 2015 at 10:10 PM, Vinson Lee <vlee at freedesktop.org> wrote:
> brw_shader.cpp: In function ‘bool brw_saturate_immediate(brw_reg_type, brw_reg*)’:
> brw_shader.cpp:618:31: warning: ‘sat_imm.brw_saturate_immediate(brw_reg_type, brw_reg*)::<anonymous union>::ud’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> reg->dw1.ud = sat_imm.ud;
> ^
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
> src/mesa/drivers/dri/i965/brw_shader.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
> index f2b4d82..ff0ef4b 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
> @@ -584,7 +584,7 @@ brw_saturate_immediate(enum brw_reg_type type, struct brw_reg *reg)
> unsigned ud;
> int d;
> float f;
> - } imm = { reg->dw1.ud }, sat_imm;
> + } imm = { reg->dw1.ud }, sat_imm = { 0 };
>
> switch (type) {
> case BRW_REGISTER_TYPE_UD:
> --
> 2.3.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
More information about the mesa-dev
mailing list