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;