PVS-StudioWarnings

PVS-Studio warning V556 for DDKSamples

Nov 13th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. PCHAR
  2. DbgDevicePowerString(IN WDF_POWER_DEVICE_STATE Type)
  3. {
  4.   ....
  5.   case WdfPowerDeviceD0:
  6.     return "WdfPowerDeviceD0";
  7.   case PowerDeviceD1:
  8.     return "WdfPowerDeviceD1";
  9.   case WdfPowerDeviceD2:
  10.     return "WdfPowerDeviceD2";
  11.   ....
  12. }
  13.  
  14. Most likely this is what should be written here: case WdfPowerDeviceD1:
  15.  
  16.  
  17. This suspicious code was found in DDKSamples project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V556 The values of different enum types are compared: switch(ENUM_TYPE_A) { case ENUM_TYPE_B: ... }. usb.c 450
  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