Boost logo

Geometry :

Subject: [ggl] abs warning on Linux
From: V D (zedxz2)
Date: 2011-09-14 06:19:23


Hi,

Just wondering if you guys are aware of the following warning with floating-point coordinates on Linux:

boost-1.47.0/include/boost/geometry/strategies/cartesian/cart_intersect.hpp:350: warning: passing ?double? for argument 1 to ?int abs(int)?
boost-1.47.0/include/boost/geometry/strategies/cartesian/cart_intersect.hpp:351: warning: passing ?double? for argument 1 to ?int abs(int)?

This happens when running boost::geometry::intersection(my_polygon, my_box) where coordinate_type of points is double, the compiler doesn't like it since only int abs(int) seems to be available on that Linux distro O_o

But grepping the code I see:

/*!
\brief Short utility to workaround gcc/clang problem that abs is converting to integer
\ingroup utility
*/
template<typename T>
inline T abs(const T& t)
{
    using std::abs;
    return abs(t);
}

Thanks,
-v
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20110913/b8ad5324/attachment.html


Geometry list run by mateusz at loskot.net