PVS-StudioWarnings

PVS-Studio warning V517 for Ultimate ToolBox

Nov 11th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. inline COXProcessIterator& operator+(int nOffset)
  2. {
  3.   if(nOffset>0)
  4.     Next(nOffset);
  5.   else if(nOffset>0)
  6.     Prev(-nOffset);
  7.   return *this;
  8. }
  9.  
  10. The V517 warning points at an error in the program logic. The "Prev(-nOffset);" branch will never be executed.
  11.  
  12.  
  13. This suspicious code was found in Ultimate ToolBox project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. UT oxprocess.h 583
  16.  
  17. 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