PVS-StudioWarnings

PVS-Studio warning V530 for amtsdk

Nov 11th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. void CimClassContainer::Clear()
  2. {
  3.   for(unsigned int i = 0; i < vec.size(); i++)
  4.   {
  5.     delete vec[i];
  6.     vec[i] = NULL;
  7.   }
  8.   vec.empty();
  9. }
  10.  
  11. This is what should have been written here: vec.clear();
  12.  
  13. This suspicious code was found in amtsdk project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V530 The return value of function 'empty' is required to be utilized. EventLogReader cimclass.h 153
  16.  
  17. 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