PVS-StudioWarnings

PVS-Studio warning V501 for CrashServer

Nov 19th, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. class FileMedia: public ILogMedia
  2. {
  3.   ....
  4.   WORD m_wLogYear, m_wLogMonth, m_wLogDay;
  5.   ....
  6. };
  7.  
  8. void FileMedia::Write(....)
  9. {
  10.   ....
  11.   if (st.wDay != m_wLogDay ||
  12.       st.wMonth != m_wLogMonth ||
  13.       st.wDay != m_wLogDay)
  14.   ....
  15. }
  16.  
  17. This suspicious code was found in CrashServer project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V501 There are identical sub-expressions 'st.wDay != m_wLogDay' to the left and to the right of the '||' operator. log.cpp 683
  20.  
  21. 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