Examples of errors detected by the V643 diagnostic


V643. Unusual pointer arithmetic. The value of the 'char' type is being added to the string pointer.


Spring Engine

V643 Unusual pointer arithmetic: ".." + io->getOsSeparator(). The value of the 'char' type is being added to the string pointer. assimp lwsloader.cpp 467


std::string LWSImporter::FindLWOFile(const std::string& in)
{
  ....
  std::string test = ".." + io->getOsSeparator() + tmp;   // <=
  if (io->Exists(test))
    return test;

  test = ".." + io->getOsSeparator() + test;              // <=
  if (io->Exists(test)) {
    return test;
  }
  ....
}

OpenToonz

V643 Unusual pointer arithmetic: "\\" + v[i]. The value of the 'char' type is being added to the string pointer. tstream.cpp 31


string escape(string v)
{
  int i = 0;
  for (;;) {
    i = v.find_first_of("\\\'\"", i);
    if (i == (int)string::npos)
      break;
    string h = "\\" + v[i]; // <=
    v.insert(i, "\\");
    i = i + 2;
  }
  return v;
}


Bugs Found

Checked Projects
334
Collected Errors
12 668