PVS-StudioWarnings

PVS-Studio warning V581 for Chromium

Nov 18th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. string16 GetAccessString(HandleType handle_type,
  2.                          ACCESS_MASK access) {
  3.   ....
  4.   if (access & FILE_WRITE_ATTRIBUTES)
  5.     output.append(ASCIIToUTF16("\tFILE_WRITE_ATTRIBUTES\n"));
  6.   if (access & FILE_WRITE_DATA)
  7.     output.append(ASCIIToUTF16("\tFILE_WRITE_DATA\n"));
  8.   if (access & FILE_WRITE_EA)
  9.     output.append(ASCIIToUTF16("\tFILE_WRITE_EA\n"));
  10.   if (access & FILE_WRITE_EA)
  11.     output.append(ASCIIToUTF16("\tFILE_WRITE_EA\n"));
  12.   break;
  13.   ....
  14. }
  15.  
  16. This suspicious code was found in Chromium project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 176, 178. handle_enumerator_win.cc 178
  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