PVS-StudioWarnings

PVS-Studio warning V547 for Source SDK

Nov 13th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. struct dedge_t
  2. {
  3.   DECLARE_BYTESWAP_DATADESC();
  4.   unsigned short  v[2];
  5. };
  6.  
  7. static void AddNodeToBounds(....)
  8. {
  9.   ....
  10.   Assert( pEdge->v[0] >= 0 );
  11.   Assert( pEdge->v[1] >= 0 );
  12.   ....
  13. }
  14.  
  15. This suspicious code was found in Source SDK project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V547 Expression 'pEdge->v[0] >= 0' is always true. Unsigned type value is always >= 0. Vbsp writebsp.cpp 1435
  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