https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61294

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
That is,

inline vtkIdType vtkPointSet::GetNumberOfPoints()
{
  if (this->Points)
    {
    return this->Points->GetNumberOfPoints();
    }
  else
    {
    return 0;
    }
}

and


void vtkDistributedDataFilter::AddConstantUnsignedCharPointArray(
  vtkUnstructuredGrid *grid, const char *arrayName, unsigned char val)
{
  vtkIdType npoints = grid->GetNumberOfPoints();
  unsigned char *vals = new unsigned char [npoints];
  memset(vals, val, npoints);
}

may allocate zero points and initialize zero points due to that extra
"safety" check.  If you put a assert (npoints > 0) in there then
the warning will go away.

Reply via email to