Skip to content

Fix uninitialized variable warning on gcc-10.3

gcc 10.3 prints the following warning:

/ccs/home/nthompson/vtk-m/vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx:54:15: warning: ‘cellId’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   54 |     return (1 - static_cast<vtkm::IdComponent>(expectedId == cellId));
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/ccs/home/nthompson/vtk-m/vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx:52:14: note: ‘cellId’ was declared here
   52 |     vtkm::Id cellId;
      |              ^~~~~~

Merge request reports