Examples of errors detected by the V678 diagnostic


V678. An object is used as an argument to its own method. Consider checking the first actual argument of the 'Foo' function.


Shareaza

V678 An object is used as an argument to its own method. Consider checking the first actual argument of the 'CompareNoCase' function. downloadwithsources.cpp 1281


void CDownloadWithSources::MergeMetadata(
  const CXMLElement* pXML)
{
  CQuickLock pLock( Transfers.m_pSection );

  CXMLAttribute* pAttr1 =
    m_pXML->GetAttribute(CXMLAttribute::schemaName);
  CXMLAttribute* pAttr2 =
    pXML->GetAttribute(CXMLAttribute::schemaName);

  if (pAttr1 && pAttr2 &&
      !pAttr1->GetValue().CompareNoCase(pAttr1->GetValue()))
    ....
}

Mozilla Thunderbird

V678 An object is used as an argument to its own method. Consider checking the first actual argument of the 'Assign' function. nsgenerichtmlelement.h 411


class nsGenericHTMLElement : public nsGenericHTMLElementBase,
                             public nsIDOMHTMLElement
{
  ....
  NS_IMETHOD GetItemId(nsAString& aId) final override {
    nsString id;
    GetItemId(id);
    aId.Assign(aId);
    return NS_OK;
  }
  ....
}


Bugs Found

Checked Projects
336
Collected Errors
12 743