PVS-StudioWarnings

PVS-Studio warning V530 for wxWidgets

Nov 20th, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. wxString m_strKey;
  2.  
  3. void wxRegKey::SetHkey(WXHKEY hKey)
  4. {
  5.   ...
  6.  
  7.   // reset old data
  8.   m_strKey.empty();
  9.   m_dwLastError = 0;
  10. }
  11.  
  12. This is what should have been written here: m_strKey.clear();
  13.  
  14. This suspicious code was found in wxWidgets project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V530 The return value of function 'empty' is required to be utilized. base registry.cpp 329
  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