Skip to content

gallium/aux: Fix Wmaybe-uninitialized warning

xantares requested to merge xantares/mesa:sum into main

I got this warning with mingw:

../src/gallium/auxiliary/draw/draw_llvm.c: In function 'draw_llvm_generate':
../src/gallium/auxiliary/draw/draw_llvm.c:1663:25: warning: 'sum' may be used uninitialized in this function [-Wmaybe-uninitialized]
 1663 |                   sum = lp_build_fmuladd(builder, planes,
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1664 |                                          (LLVMValueRef[]){cv_x, cv_y, cv_z, cv_w}[i], sum);
      |                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/gallium/auxiliary/draw/draw_llvm.c:1511:44: note: 'sum' was declared here
 1511 |    LLVMValueRef plane1, planes, plane_ptr, sum;
      |                                            ^~~

Merge request reports