Advertisement
PVS-StudioWarnings

PVS-Studio warning V648 for VirtualBox

Nov 21st, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. static DECLCALLBACK(int) drvACPIQueryPowerSource(....)
  2. {
  3.   ....
  4.   /* running on battery? */
  5.   if (powerStatus.ACLineStatus == 0   /* Offline */
  6.    || powerStatus.ACLineStatus == 255 /* Unknown */
  7.        && (powerStatus.BatteryFlag & 15))
  8.   {
  9.     *pPowerSource = PDM_ACPI_POWER_SOURCE_BATTERY;
  10.   }
  11.   ....
  12. }
  13.  
  14. This suspicious code was found in VirtualBox project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V648 Priority of the '&&' operation is higher than that of the '||' operation. drvacpi.cpp 132
  17.  
  18. 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
Advertisement