PVS-StudioWarnings

PVS-Studio warning V521 for GDCM

Nov 12th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. bool Sorter::StableSort(
  2.   std::vector<std::string> const & filenames)
  3. {
  4.   ....
  5.   std::vector< SmartPointer<FileWithName> >::iterator
  6.     it2 = filelist.begin();
  7.  
  8.   for( Directory::FilenamesType::const_iterator it =
  9.          filenames.begin();
  10.        it != filenames.end(), it2 != filelist.end();
  11.        ++it, ++it2)
  12.   {
  13.   ....
  14. }
  15.  
  16. This suspicious code was found in GDCM project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V521 Such expressions using the ',' operator are dangerous. Make sure the expression is correct. gdcmsorter.cxx 82
  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