Advertisement
PVS-StudioWarnings

PVS-Studio warning V523 for ITK

Nov 27th, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. void MetaDTITube::
  2. PrintInfo() const
  3. {
  4.   MetaObject::PrintInfo();
  5.   METAIO_STREAM::cout << "ParentPoint = " << m_ParentPoint
  6.                       << METAIO_STREAM::endl;
  7.   if(m_Root)
  8.   {
  9.     METAIO_STREAM::cout << "Root = "
  10.                         << "True" << METAIO_STREAM::endl;
  11.   }
  12.   else
  13.   {
  14.     METAIO_STREAM::cout << "Root = "
  15.                         << "True" << METAIO_STREAM::endl;
  16.   }
  17.   ....
  18. }
  19.  
  20. This suspicious code was found in ITK project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V523 The 'then' statement is equivalent to the 'else' statement. metadtitube.cxx 155
  23.  
  24. 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
Advertisement