PVS-StudioWarnings

PVS-Studio warning V501 for Clang

Nov 18th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1. static unsigned getTypeOfMaskedICmp(....)
  2. {
  3.   ...
  4.   result |= (icmp_eq ? (FoldMskICmp_Mask_AllZeroes |
  5.                         FoldMskICmp_Mask_AllZeroes |
  6.                         FoldMskICmp_AMask_Mixed |
  7.                         FoldMskICmp_BMask_Mixed)
  8.                      : (FoldMskICmp_Mask_NotAllZeroes |
  9.                         FoldMskICmp_Mask_NotAllZeroes |
  10.                         FoldMskICmp_AMask_NotMixed |
  11.                         FoldMskICmp_BMask_NotMixed));
  12.   ...
  13. }
  14.  
  15. This suspicious code was found in Clang project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V501 There are identical sub-expressions 'FoldMskICmp_Mask_AllZeroes' to the left and to the right of the '|' operator. LLVMInstCombine instcombineandorxor.cpp 505
  18.  
  19. 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