PVS-StudioWarnings

PVS-Studio warning V510 for WinMerge

Nov 10th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. static void StoreDiffData(DIFFITEM &di, CDiffContext * pCtxt,
  2.   const FolderCmp * pCmpData)
  3. {
  4.   ...
  5.   GetLog()->Write
  6.   (
  7.     CLogFile::LCOMPAREDATA,
  8.     _T("name=<%s>, leftdir=<%s>, rightdir=<%s>, code=%d"),
  9.     di.left.filename.c_str(),
  10.     di.left.path.c_str(),
  11.     di.right.path.c_str(),
  12.     di.diffcode
  13.   );
  14.   pCtxt->m_pCompareStats->AddItem(di.diffcode.diffcode);
  15.   ...
  16. }
  17.  
  18. 'di.diffcode' is class object. Most likely this is what should be written here: di.diffcode.diffcode.
  19.  
  20. This suspicious code was found in WinMerge project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V510 The 'Write' function is not expected to receive class-type variable as sixth actual argument. Merge dirscan.cpp 565
  23.  
  24. 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