PVS-StudioWarnings

PVS-Studio warning V530 for wxWidgets

Nov 21st, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. bool wxMsgCatalogFile::LoadData(....)
  2. {
  3.   ...
  4.   wxString m_charset;
  5.   ...
  6.   if ( m_charset == wxS("CHARSET") )
  7.   {
  8.     m_charset.empty();
  9.   }
  10.   ...
  11. }
  12.  
  13. This is what should have been written here: m_charset.clear();
  14.  
  15. This suspicious code was found in wxWidgets project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V530 The return value of function 'empty' is required to be utilized. base translation.cpp 989
  18.  
  19. 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