PVS-StudioWarnings

PVS-Studio warning V530 for WinMerge

Nov 13th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. /**
  2. * @brief Clear variant's value (reset to defaults).
  3. */
  4. void VariantValue::Clear()
  5. {
  6.   m_vtype = VT_NULL;
  7.   m_bvalue = false;
  8.   m_ivalue = 0;
  9.   m_fvalue = 0;
  10.   m_svalue.empty();
  11.   m_tvalue = 0;
  12. }
  13.  
  14. This is what should have been written here: m_svalue.clear();
  15.  
  16. This suspicious code was found in WinMerge project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V530 The return value of function 'empty' is required to be utilized
  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