PVS-StudioWarnings

PVS-Studio warning V524 for TPP

Nov 18th, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. CharIndexedVectorIterator operator++(int)
  2. {  // postincrement
  3.   CharIndexedVectorIterator _Tmp = *this;
  4.   ++m_itr;
  5.   return (_Tmp);
  6. }
  7.  
  8. CharIndexedVectorIterator& operator--()
  9. {  // predecrement
  10.   ++m_itr;
  11.   return (*this);
  12. }
  13.  
  14. This suspicious code was found in TPP project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V524 It is odd that the body of '--' function is fully equivalent to the body of '++' function. charindexedvector.hpp 81
  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