PVS-StudioWarnings

PVS-Studio warning V547 for ReactOS

Nov 13th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. typedef UINT_PTR SOCKET;
  2. #define ADNS_SOCKET SOCKET
  3.  
  4. struct adns__state {
  5.   ....
  6.   ADNS_SOCKET udpsocket, tcpsocket;
  7.   ....
  8. };
  9.  
  10. static int init_finish(adns_state ads) {
  11.   ....
  12.   if (ads->udpsocket<0) { r= errno; goto x_free; }
  13.   ....
  14. }
  15.  
  16. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V547 Expression 'ads->udpsocket < 0' is always false. Unsigned type value is never < 0. setup.c 539
  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