Advertisement
PVS-StudioWarnings

PVS-Studio warning V501 for WinMerge

Nov 25th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. BUFFERTYPE m_nBufferType[2];
  2. ...
  3. // Handle unnamed buffers
  4. if ((m_nBufferType[nBuffer] == BUFFER_UNNAMED) ||
  5.     (m_nBufferType[nBuffer] == BUFFER_UNNAMED))
  6.   nSaveErrorCode = SAVE_NO_FILENAME;
  7.  
  8. If we look at the code nearby, the following should be written here by analogy: (m_nBufferType[0] == BUFFER_UNNAMED) || (m_nBufferType[1] == BUFFER_UNNAMED).
  9.  
  10. This suspicious code was found in WinMerge project by PVS-Studio static code analyzer.
  11. Warning message is:
  12. V501 There are identical sub-expressions to the left and to the right of the '||' operator
  13.  
  14. 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
Advertisement