PVS-StudioWarnings

PVS-Studio warning V629 for SeqAn

Nov 20th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. template <typename TValue, unsigned SIZE>
  2. struct Tuple<TValue, SIZE, BitPacked<> >
  3. {
  4.   typedef typename
  5.     BitVector_<SIZE * BitsPerValue<TValue>::VALUE>::Type
  6.     TBitVector;
  7.  
  8.   static const __uint64 BIT_MASK =
  9.     (1 << BitsPerValue<TValue>::VALUE) - 1;
  10.   ....
  11. }
  12.  
  13. This suspicious code was found in SeqAn project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V629 Consider inspecting the '1 << BitsPerValue < TValue >::VALUE' expression. Bit shifting of the 32-bit value with a subsequent expansion to the 64-bit type. tuple_bit_compressed.h 88
  16.  
  17. 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