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


The analyzer has detected a potential error: an unused concatenation of string variables in the code was found. The types of these variables are as follows: std::string, CString, QString, wxString. These expressions most often appear in the code when an assignment operator is missing or as a result of careless code refactoring.

Consider the following sample of incorrect code:

void Foo(std::string &s1, const std::string &s2)
{
  s1 + s2;
}

The code contains a misprint: '+' is written instead of '+='. The code compiles well but is senseless. This is the fixed code:

void Foo(std::string &s1, const std::string &s2)
{
  s1 += s2;
}

According to Common Weakness Enumeration, potential errors found by using this diagnostic are classified as CWE-480.

You can look at examples of errors detected by the V655 diagnostic.


Bugs Found

Checked Projects
346
Collected Errors
13 188