Advertisement
PVS-StudioWarnings

PVS-Studio warning V530 for TortoiseSVN

Nov 26th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. CMailMsg& CMailMsg::SetTo(string sAddress,
  2.                           string sName)
  3. {
  4.    if (initIfNeeded())
  5.    {
  6.       // only one recipient allowed
  7.       if (m_to.size())
  8.          m_to.empty();
  9.  
  10.       m_to.push_back(TStrStrPair(sAddress,sName));
  11.    }
  12.    return *this;
  13. }
  14.  
  15. This is what should have been written here: m_to.clear();
  16.  
  17. This suspicious code was found in TortoiseSVN project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V530 The return value of function 'empty' is required to be utilized. mailmsg.cpp 54
  20.  
  21. 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