PVS-StudioWarnings

PVS-Studio warning V530 for TPP

Nov 20th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. static void clearTagNames() {
  2.    std::vector<const char *>ptrs;
  3.    for (tagname_set::iterator i = tagnames.begin();
  4.         i!=tagnames.end();i++) {
  5.       ptrs.push_back(*i);
  6.    }
  7.    for (tagname_set::iterator j = attrnames.begin();
  8.         j!=attrnames.end();j++) {
  9.       ptrs.push_back(*j);
  10.    }
  11.    tagnames.empty();
  12.    attrnames.empty();
  13.    for (size_t n=ptrs.size();n--;) {
  14.       delete [] (char *)(ptrs[n]); // cast away const
  15.    }
  16. }
  17.  
  18. This suspicious code was found in TPP project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V530 The return value of function 'empty' is required to be utilized. tag.cxx 72
  21.  
  22. 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