PVS-StudioWarnings

PVS-Studio warning V517 for MAME

Nov 19th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. static WRITE8_HANDLER( tms70x0_pf_w )
  2. {
  3.   ...
  4.   if( ((cpustate->pf[0x03] & 0x80) == 0) &&
  5.       ((data & 0x80) == 0x80 ) )
  6.   {
  7.     ...
  8.   }
  9.   else if( ((data & 0x80) == 0x80 ) &&
  10.            ((cpustate->pf[0x03] & 0x80) == 0) )
  11.   {
  12.     ...
  13.   }
  14.   ...
  15. }
  16.  
  17. This suspicious code was found in MAME project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 577, 584.  tms7000.c 577
  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