PVS-StudioWarnings

PVS-Studio warning V501 for VTK

Nov 12th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. template <class iterT>
  2. void vtkDataSetAttributesCopyValues(....)
  3. {
  4.   ...
  5.   inZPtr +=
  6.     (outExt[0]-outExt[0])*inIncs[0] * data_type_size +
  7.     (outExt[2] - outExt[2])*inIncs[1] * data_type_size +
  8.     (outExt[4] - outExt[4])*inIncs[2] * data_type_size;
  9.   ...
  10. }
  11.  
  12. Meaningless code. It's equivalent to inZPtr += 0;
  13.  
  14. This suspicious code was found in VTK project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V501 There are identical sub-expressions to the left and to the right of the '-' operator: outExt[0] - outExt[0] vtkFiltering vtkdatasetattributes.cxx 457
  17.  
  18. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment