PVS-StudioWarnings

PVS-Studio warning V530 for TortoiseSVN

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