PVS-StudioWarnings

PVS-Studio warning V510 for WinMerge

Nov 24th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. std::wstring m_strLogPath;
  2.  
  3. void CLogFile::EnableLogging(BOOL bEnable)
  4. {
  5.   ...
  6.   Write(_T("Path: %s\n*******\n"), m_strLogPath);
  7.   ...
  8. }
  9.  
  10. This is what should have been written here: m_strLogPath.c_str()
  11.  
  12. This suspicious code was found in WinMerge project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V510 The 'Write' function is not expected to receive class-type variable as second actual argument. Merge logfile.cpp 85
  15.  
  16. 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