MantisBT - VTK
View Issue Details
0012570VTK(No Category)public2011-09-02 17:572013-04-05 20:28
Alfredo Morales 
David Partyka 
highminorhave not tried
closedfixed 
 
 
Kitware
crash
0012570: Compilation Error vtk release 5.6.1 in Fedora 15
Trying to compile the release 5.6.1 in Fedora 15 I got an error. In the class VTK/Utilities/vtkmetaio/metaUtils.cxx the compiler doesn't recognize the variable ptrdiff_t and it recommended to change it to std::ptrdiff_t.

I did the change and I got vtk compiled.

The method that I modified was "bool MET_StringToWordArray(const char *s, int *n, char ***val)" and the final result is:

bool MET_StringToWordArray(const char *s, int *n, char ***val)
{
  std::ptrdiff_t l = strlen(s);

  std::ptrdiff_t p = 0;
  while(p<l && s[p] == ' ')
    {
    p++;
    }

  *n = 0;
  std::ptrdiff_t pp = p;
  bool space = false;
  while(pp<l)
    {
    if(s[pp] == ' ' && !space)
      {
      (*n)++;
      space = true;
      }
    else
      {
      space = false;
      }
    pp++;
    }
  pp=l-1;
  if(s[pp] == ' ')
    {
    while(pp>=0 && s[pp] == ' ')
      {
      (*n)--;
      pp--;
      }
    }
  else
    {
    (*n)++;
    }

  *val = new char *[*n];

  std::ptrdiff_t i, j;
  for(i=0; i<*n; i++)
    {
    if(p == l)
      {
      return false;
      }

    (*val)[i] = new char [80];
    while(p<l && s[p] == ' ')
      {
      p++;
      }
    j = 0;
    while(p<l && s[p] != ' ')
      {
      (*val)[i][j++] = s[p++];
      }
    (*val)[i][j] = '\0';
    }

  return true;
}

I hope this will help the development of future releases.

Alfredo Morales Pinzón.
No tags attached.
Issue History
2011-09-02 17:57Alfredo MoralesNew Issue
2011-09-02 18:04David PartykaNote Added: 0027452
2011-09-02 18:07David PartykaAssigned To => David Partyka
2011-09-02 18:07David PartykaStatusbacklog => todo
2011-09-02 18:07David PartykaStatustodo => active development
2011-09-02 18:07David PartykaStatusactive development => gatekeeper review
2011-09-02 18:07David PartykaStatusgatekeeper review => customer review
2013-04-05 20:28Berk GeveciStatuscustomer review => closed
2013-04-05 20:28Berk GeveciResolutionopen => fixed

Notes
(0027452)
David Partyka   
2011-09-02 18:04   
Please try vtk 5.8.0 and let us know if there is still an issue.