Advertisement
PVS-StudioWarnings

PVS-Studio warning V654 for WebRTC

Nov 21st, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #define TCP_PORT_RETRY_CNT  5
  2.  
  3. cpr_socket_t
  4. cprSecSocConnect (char *host,
  5.                   int     port,
  6.                   int     ipMode,
  7.                   boolean mode,
  8.                   uint32_t tos,
  9.                   uint16_t *localPort)
  10. {
  11.   ....
  12.   uint16_t loopCnt  = 0;
  13.   ....
  14.   while (loopCnt < TCP_PORT_RETRY_CNT) {
  15.     ....
  16.     .... // loopCnt not changed
  17.     ....
  18.   }
  19.   ....
  20. }
  21.  
  22. This suspicious code was found in WebRTC project by PVS-Studio static code analyzer.
  23. Warning message is:
  24. V654 The condition 'loopCnt < 5' of loop is always true. cpr_win_socket.c 746
  25.  
  26. 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