Silence alignment change cast in vtkImageReader.cxx
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Run into this with our 'paranoid' build flags and CLang. Git version 86d15625
CLang complains about line 324 in vtkImageReader.cxx
Not a real problem because the templating should mean that casting to a wider type is actually a good cast. The patch below makes the warning go away, though there might be a more elegant solution:
diff --git a/IO/Image/vtkImageReader.cxx b/IO/Image/vtkImageReader.cxx index 1125fee..eaccc09 100644 --- a/IO/Image/vtkImageReader.cxx +++ b/IO/Image/vtkImageReader.cxx @@ -321,7 +321,7 @@ void vtkImageReaderUpdate2(vtkImageReader *self, vtkImageData *data, }
// copy the bytes into the typed data
-
inPtr = (IT *)(buf);
-
inPtr = (IT *)(void *)(buf); for (idx0 = dataExtent[0]; idx0 <= dataExtent[1]; ++idx0) { // Copy pixel into the output.