PVS-StudioWarnings

PVS-Studio warning V547 for MAME

Nov 13th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. int m_led_extender;
  2. #define CARD_A   1
  3. #define NO_EXTENDER  0
  4.  
  5. static WRITE8_DEVICE_HANDLER( pia_ic5_porta_w )
  6. {
  7.   ...
  8.   else if ((state->m_led_extender != CARD_A)||
  9.            (state->m_led_extender != NO_EXTENDER))
  10.   ...
  11. }
  12.  
  13. This suspicious code was found in MAME project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V547 Expression is always true. Probably the '&&' operator should be used here.  mpu4.c 934
  16.  
  17. 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