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;
  }
  ....
}

Command & Conquer

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


void InfantryClass::Assign_Target(TARGET target)
{
  ....
  if (building && building->Class->IsCaptureable &&
    (GameToPlay != GAME_NORMAL || *building != STRUCT_EYE && Scenario < 13)) {
    Assign_Destination(target);
  }
  ....
}

Similar errors can be found in some other places:

  • V648 Priority of the '&&' operation is higher than that of the '||' operation. TEAM.CPP 456
  • V648 Priority of the '&&' operation is higher than that of the '||' operation. DISPLAY.CPP 1160
  • V648 Priority of the '&&' operation is higher than that of the '||' operation. DISPLAY.CPP 1571
  • And 2 additional diagnostic messages.


Bugs Found

Checked Projects
409
Collected Errors
14 072
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site. Learn More →
Accept