PVS-StudioWarnings

PVS-Studio warning V517 for ITK

Nov 19th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. void DiffusionTensor3DReconstructionImageFilter<....>
  2. ::PrintSelf(std::ostream & os, Indent indent) const
  3. {
  4.   ....
  5.   if ( this->m_GradientImageTypeEnumeration ==
  6.        GradientIsInManyImages )
  7.   {
  8.     os << indent
  9.        << "Gradient images haven been supplied "
  10.        << std::endl;
  11.   }
  12.   else if ( this->m_GradientImageTypeEnumeration ==
  13.              GradientIsInManyImages )
  14.   {
  15.     os << indent
  16.        << "A multicomponent gradient image has been supplied"
  17.        << std::endl;
  18.   }
  19.   ....
  20. }
  21.  
  22. This suspicious code was found in ITK project by PVS-Studio static code analyzer.
  23. Warning message is:
  24. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 654, 658. itkdiffusiontensor3dreconstructionimagefilter.hxx 654
  25.  
  26. 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