Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
Examples of errors detected by the...

Examples of errors detected by the V655 diagnostic

V655. Strings were concatenated but not used. Consider inspecting the expression.


OrcaSlicer

V655 The strings were concatenated but are not utilized. Consider inspecting the 'message + "\n\nApplication will close."' expression. GUI_App.cpp 7170


bool GUI_App::load_language(wxString language, bool initial)
{
  // ....
    if (!wxLocale::IsAvailable(locale_language_info->Language)) {
    // Loading the language dictionary failed.
    wxString message =   "Switching Orca Slicer to language "
                       + requested_language_code + " failed.";
#if !defined(_WIN32) && !defined(__APPLE__)
      // likely some linux system
      message += "\nYou may need to reconfigure the missing locales, "
                 " likely by running the \"locale-gen\" "
                 "and \"dpkg-reconfigure locales\" commands.\n";
#endif
    if (initial)
      message + "\n\nApplication will close.";              // <=
    wxMessageBox(message, "Orca Slicer - Switching language failed",
                 wxOK | wxICON_ERROR);
    if (initial)
      std::exit(EXIT_FAILURE);
    else
      return false;
  }
  // ....
}

The code uses `+` instead of `+=`, so the string literal never gets appended to the `message` variable.


LLVM/Clang

V655 [CWE-480] The strings were concatenated but are not utilized. Consider inspecting the 'Result + Name.str()' expression. Symbol.cpp 32


LLVM_DUMP_METHOD void Symbol::dump(raw_ostream &OS) const {
  std::string Result;
  if (isUndefined())
    Result += "(undef) ";
  if (isWeakDefined())
    Result += "(weak-def) ";
  if (isWeakReferenced())
    Result += "(weak-ref) ";
  if (isThreadLocalValue())
    Result += "(tlv) ";
  switch (Kind) {
  case SymbolKind::GlobalSymbol:
    Result + Name.str();                        // <=
    break;
  case SymbolKind::ObjectiveCClass:
    Result + "(ObjC Class) " + Name.str();      // <=
    break;
  case SymbolKind::ObjectiveCClassEHType:
    Result + "(ObjC Class EH) " + Name.str();   // <=
    break;
  case SymbolKind::ObjectiveCInstanceVariable:
    Result + "(ObjC IVar) " + Name.str();       // <=
    break;
  }
  OS << Result;
}

Similar errors can be found in some other places:

  • V655 [CWE-480] The strings were concatenated but are not utilized. Consider inspecting the 'Result + "(ObjC Class) " + Name.str()' expression. Symbol.cpp 35
  • V655 [CWE-480] The strings were concatenated but are not utilized. Consider inspecting the 'Result + "(ObjC Class EH) " + Name.str()' expression. Symbol.cpp 38
  • V655 [CWE-480] The strings were concatenated but are not utilized. Consider inspecting the 'Result + "(ObjC IVar) " + Name.str()' expression. Symbol.cpp 41

OpenToonz

V655 The strings were concatenated, but are not utilized. Consider inspecting the 'alias + "]"' expression. plasticdeformerfx.cpp 150


string PlasticDeformerFx::getAlias(....) const
{
  std::string alias(getFxType());
  alias += "[";
  ....
  if (sd)
    alias += ", "+toString(sd, meshColumnObj->paramsTime(frame));

  alias + "]"; // <=

  return alias;
}

FreeCAD

V655 The strings were concatenated but are not utilized. Consider inspecting the expression. propertyitem.cpp 1013


void
PropertyVectorDistanceItem::setValue(const QVariant& variant)
{
  if (!variant.canConvert<Base::Vector3d>())
      return;
  const Base::Vector3d& value = variant.value<Base::Vector3d>();

  Base::Quantity q = Base::Quantity(value.x, Base::Unit::Length);
  QString unit = QString::fromLatin1("('%1 %2'").arg(....;
  q = Base::Quantity(value.y, Base::Unit::Length);
  unit + QString::fromLatin1("'%1 %2'").arg(....;   // <=

  setPropertyValue(unit);
}

K Desktop Environment

V655 The strings were concatenated but are not utilized. Consider inspecting the expression. entrydetailsdialog.cpp 225


void EntryDetails::updateButtons()
{
  ....
  foreach (....) {
    QString text = info.name;
    if (!info.distributionType.trimmed().isEmpty()) {
      text + " (" + info.distributionType.trimmed() + ")"; // <=
    }
    QAction* installAction =
      installMenu->addAction(KIcon("dialog-ok"), text);
    installAction->setData(info.id);
  }
  ....
}

Similar errors can be found in some other places:

  • V655 The strings were concatenated but are not utilized. Consider inspecting the expression. itemsgridviewdelegate.cpp 365
  • V655 The strings were concatenated but are not utilized. Consider inspecting the expression. itemsviewdelegate.cpp 159

Scilab

V655 The strings were concatenated but are not utilized. Consider inspecting the 'szCurLevel + "."' expression. sci_displaytree.cpp 80


int sci_displaytree(char *fname, unsigned long fname_len)
{
  ....
  string szCurLevel = "";
  ....
  //Add node level
  if (szCurLevel != "")
  {
    szCurLevel + ".";
  }
  ....
}

Take
a chance!

Take a chance —
spin a wheel.

Prize circle Prize circle Outer ring

Congrats! You've won a 30-day trial license!

You tricked the system, well done! Get a 30-day trial as your prize!