Examples of errors detected by the V648 diagnostic.


V648. Priority of the '&&' operation is higher than that of the '||' operation.


Wolfenstein 3D

V648 Priority of the '&&' operation is higher than that of the '||' operation. math_quaternion.h 167


inline int operator!=( quat_t a, quat_t b )
{
  return ( ( a.x != b.x ) || ( a.y != b.y ) ||
           ( a.z != b.z ) && ( a.w != b.w ) );
}

Most likely this is what should be written here: ( a.z != b.z ) || ( a.w != b.w ).


Oracle VM Virtual Box

V648 Priority of the '&&' operation is higher than that of the '||' operation. drvacpi.cpp 132


static DECLCALLBACK(int) drvACPIQueryPowerSource(....)
{
  ....
  /* running on battery? */
  if (powerStatus.ACLineStatus == 0   /* Offline */
   || powerStatus.ACLineStatus == 255 /* Unknown */
       && (powerStatus.BatteryFlag & 15))
  {
    *pPowerSource = PDM_ACPI_POWER_SOURCE_BATTERY;
  }
  ....
}


Do you make errors in the code?

Check your code
with PVS-Studio

Static code analysis
for C, C++, and C#

goto PVS-Studio;
We use cookies for the analysis of events to improve our content and make user interaction more convenient. By continuing the view of our web-pages you accept the terms of using these files. You can find out more about cookie-files and privacy policy or close the notification, by clicking on the button. Learn More →
Do not show