PVS-StudioWarnings

PVS-Studio warning V547 for TortoiseGIT

Nov 26th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. enum git_ack_status {
  2.   GIT_ACK_NONE,
  3.   GIT_ACK_CONTINUE,
  4.   GIT_ACK_COMMON,
  5.   GIT_ACK_READY
  6. };
  7.  
  8. static int wait_while_ack(gitno_buffer *buf)
  9. {
  10.   ....
  11.   if (pkt->type == GIT_PKT_ACK &&
  12.       (pkt->status != GIT_ACK_CONTINUE ||
  13.        pkt->status != GIT_ACK_COMMON)) {
  14.   ....
  15. }
  16.  
  17. This suspicious code was found in TortoiseGIT project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V547 Expression is always true. Probably the '&&' operator should be used here. smart_protocol.c 264
  20.  
  21. 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