PVS-StudioWarnings

PVS-Studio warning V517 for MAME

Nov 18th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. static void cdrom_get_info_from_type_string(....)
  2. {
  3.  
  4.   ...
  5.   else if (!strcmp(typestring, "MODE2/2336"))
  6.   {
  7.     *trktype = CD_TRACK_MODE2;
  8.     *datasize = 2336;
  9.   }
  10.   ...
  11.   else if (!strcmp(typestring, "MODE2/2336"))
  12.   {
  13.     *trktype = CD_TRACK_MODE2_FORM_MIX;
  14.     *datasize = 2336;
  15.   }
  16.   ...
  17. }
  18.  
  19. This suspicious code was found in MAME project by PVS-Studio static code analyzer.
  20. Warning message is:
  21. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 549, 579.  cdrom.c 549
  22.  
  23. 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