View Issue Details

IDProjectCategoryView StatusLast Update
0003811Slicer4Module VolumeRenderingpublic2018-10-16 11:54
ReporterjcfrAssigned Tofinetjul 
PrioritylowSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in VersionSlicer 4.8.1 
Summary0003811: Fix -Wmaybe-uninitialized warning in vtkSlicerFixedPointVolumeRayCastCompositeGOHelper
Description

Slicer r23591

Release build / Ubuntu 13.10 / g++ (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1

In file included from /path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastCompositeGOHelper.h:34:0,
from /path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastCompositeGOHelper.cxx:18:
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastHelper.h: In function ‘void vtkSlicerFixedPointCompositeGOHelperGenerateImageIndependentNN(T, int, int, vtkSlicerFixedPointVolumeRayCastMapper, vtkVolume) [with T = double]’:
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastHelper.h:431:63: warning: ‘mag[2]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
_alpha[_idx] = static_cast<unsigned short>((_alpha[_idx]
GOTABLE[_idx][MAG[_idx]] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
^
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastCompositeGOHelper.cxx:276:19: note: ‘mag[2]’ was declared here
unsigned char mag[4];
^
In file included from /path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastCompositeGOHelper.h:34:0,
from /path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastCompositeGOHelper.cxx:18:
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastHelper.h:431:63: warning: ‘mag[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
_alpha[_idx] = static_cast<unsigned short>((_alpha[_idx]GOTABLE[_idx][MAG[_idx]] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
^
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastCompositeGOHelper.cxx:276:19: note: ‘mag[1]’ was declared here
unsigned char mag[4];
^
[ 73%] Built target qSlicerVolumesModuleWidgets
In file included from /path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastCompositeGOHelper.h:34:0,
from /path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastCompositeGOHelper.cxx:18:
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastHelper.h: In function ‘void vtkSlicerFixedPointCompositeGOHelperGenerateImageIndependentNN(T
, int, int, vtkSlicerFixedPointVolumeRayCastMapper, vtkVolume) [with T = float]’:
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastHelper.h:431:63: warning: ‘mag[2]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
_alpha[_idx] = static_cast<unsigned short>((_alpha[_idx]GOTABLE[_idx][MAG[_idx]] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
^
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastCompositeGOHelper.cxx:276:19: note: ‘mag[2]’ was declared here
unsigned char mag[4];
^
In file included from /path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastCompositeGOHelper.h:34:0,
from /path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastCompositeGOHelper.cxx:18:
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastHelper.h:431:63: warning: ‘mag[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
_alpha[_idx] = static_cast<unsigned short>((_alpha[_idx]
GOTABLE[_idx][MAG[_idx]] + 0x7fff)>>(VTKKW_FP_SHIFT)); \
^
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastCompositeGOHelper.cxx:276:19: note: ‘mag[1]’ was declared here
unsigned char mag[4];
^

TagsNo tags attached.

Activities

jcfr

jcfr

2014-08-20 11:57

administrator   ~0012405

Would it make sense to initialize "mag" array with 0 ?

unsigned char mag[4] = {0, 0, 0, 0};

See https://github.com/Slicer/Slicer/blob/0b6e4a726ecab4789dd0ca85729856b313cd42be/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastCompositeGOHelper.cxx#l276

jcfr

jcfr

2014-08-20 12:27

administrator   ~0012406

Similar warnings:

// -----------------------------
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastMIPHelper.cxx: In function ‘void vtkSlicerFixedPointMIPHelperGenerateImageIndependentNN(T, int, int, vtkSlicerFixedPointVolumeRayCastMapper, vtkVolume) [with T = double]’:
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastMIPHelper.cxx:225:9: warning: ‘maxValue[3]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if ( VTKKWRCHelper_MIPSpaceLeapCheckMulti( c ) &&
^
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastMIPHelper.cxx: In function ‘void vtkSlicerFixedPointMIPHelperGenerateImageIndependentNN(T
, int, int, vtkSlicerFixedPointVolumeRayCastMapper, vtkVolume) [with T = float]’:
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastMIPHelper.cxx:225:9: warning: ‘maxValue[3]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastMIPHelper.cxx: In function ‘void vtkSlicerFixedPointMIPHelperGenerateImageIndependentNN(T, int, int, vtkSlicerFixedPointVolumeRayCastMapper, vtkVolume) [with T = long long int]’:
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastMIPHelper.cxx:225:9: warning: ‘maxValue[3]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastMIPHelper.cxx: In function ‘void vtkSlicerFixedPointMIPHelperGenerateImageIndependentNN(T
, int, int, vtkSlicerFixedPointVolumeRayCastMapper, vtkVolume) [with T = long long unsigned int]’:
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastMIPHelper.cxx:225:9: warning: ‘maxValue[3]’ may be used uninitialized in this function [-Wmaybe-uninitialized]

// -----------------------------
In file included from /path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastMIPHelper.h:28:0,
from /path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastMIPHelper.cxx:15:
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastHelper.h: In function ‘void vtkSlicerFixedPointMIPHelperGenerateImageDependentNN(T, int, int, vtkSlicerFixedPointVolumeRayCastMapper, vtkVolume*) [with T = unsigned char]’:
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastHelper.h:342:14: warning: ‘maxIdx[3]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
_alpha = SCALAROPACITYTABLE[IDX[3]]; \
^
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastMIPHelper.cxx:163:20: note: ‘maxIdx[3]’ was declared here
unsigned short maxIdx[4];
^
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastMIPHelper.cxx:169:63: warning: ‘maxIdx[2]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
maxIdx, components, imagePtr );
^
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastMIPHelper.cxx:169:63: warning: ‘maxIdx[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
/path/to/Slicer/Modules/Loadable/VolumeRendering/VolumeRenderingReplacements/vtkSlicerFixedPointVolumeRayCastMIPHelper.cxx:169:63: warning: ‘maxIdx[0]’ may be used uninitialized in this function [-Wmaybe-uninitialized]

jcfr

jcfr

2018-10-16 11:54

administrator   ~0016156

Fixed in r25972: ENH: Remove unused VolumeRenderingReplacements fixed point raycaster override
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=25972

Issue History

Date Modified Username Field Change
2014-08-20 11:52 jcfr New Issue
2014-08-20 11:52 jcfr Status new => assigned
2014-08-20 11:52 jcfr Assigned To => finetjul
2014-08-20 11:53 jcfr Description Updated
2014-08-20 11:57 jcfr Note Added: 0012405
2014-08-20 11:58 jcfr Description Updated
2014-08-20 12:27 jcfr Note Added: 0012406
2018-10-16 11:54 jcfr Status assigned => resolved
2018-10-16 11:54 jcfr Resolution open => fixed
2018-10-16 11:54 jcfr Fixed in Version => Slicer 4.8.1
2018-10-16 11:54 jcfr Note Added: 0016156