[vtk-developers] Dashboard problems: ambiguous conversion fabs() call

David Gobbi david.gobbi at gmail.com
Thu Aug 16 08:30:44 EDT 2012


The dashboard has failures on Windows and AIX from the use of fabs()
in the templated vtkTuple class.  The problem seems to be that
"#include <math.h>" provide the overloaded c++ fabs() on those
systems, instead of providing the C fabs().  This problem appeared for
the first time because the vtkTuple::Compare type is being wrapped,
which finally causes it to be exercised for integer types.

In order to keep things consistent across platforms, why aren't we
using the std:: qualifier on these calls?  I.e.:

#include <cmath>
std::fabs(...)

There are tons of places in VTK where I see things like this:

#include <cmath>
fabs()

In the latter, it isn't clear whether the coder wants the C fabs() or
the overloaded C++ std::fabs().

I've pushed a fix for the vtkTuple dashboard issues, could people look
at both changeset 3 and changeset 4 and let me know which is the
preferred solution?

http://review.source.kitware.com/#/t/1092/

 - David



More information about the vtk-developers mailing list