PVS-StudioWarnings

PVS-Studio warning V547 for ReactOS

Nov 10th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. INT
  2. WSAAPI
  3. connect(IN SOCKET s,
  4.         IN CONST struct sockaddr *name,
  5.         IN INT namelen)
  6. {
  7.   ...
  8.   /* Check if error code was due to the host not being found */
  9.   if ((Status == SOCKET_ERROR) &&
  10.       (ErrorCode == WSAEHOSTUNREACH) &&
  11.       (ErrorCode == WSAENETUNREACH))
  12.   {
  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 is always false. Probably the '||' operator should be used here. ws2_32_new sockctrl.c 55
  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