Subject: [Boost-bugs] [Boost C++ Libraries] #6052: unqualified sqrt() fails with SunCC
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-10-24 19:01:42
#6052: unqualified sqrt() fails with SunCC
------------------------------------------------------+---------------------
Reporter: Fedor Sergeev <Fedor.Sergeev@â¦> | Owner: ljsimons
Type: Bugs | Status: new
Milestone: To Be Determined | Component: polygon
Version: Boost 1.47.0 | Severity: Problem
Keywords: |
------------------------------------------------------+---------------------
polygon/gtl_boost_unit_test fails to compile with SunCC
{{{
] sunCC -library=stlport4 -I. libs/polygon/test/gtl_boost_unit_test.cpp
...
"./boost/polygon/rectangle_concept.hpp", line 934: Error: The function
"sqrt" must have a prototype.
"libs/polygon/test/gtl_boost_unit_test.cpp", line 794: Where: While
instantiating
"boost::polygon::euclidean_distance<boost::polygon::rectangle_data<int>,
boost::polygon::rectangle_data<int>>(const boost::
"libs/polygon/test/gtl_boost_unit_test.cpp", line 794: Where:
Instantiated from non-template code.
...
]
}}}
Polygon sources use quite a number of unqualified sqrt() calls.
However the standard header they include - '''{{{<cmath>}}}''' - is not
required to inject math functions into the global namespace.
Thus the only standard way to use these functions (sqrt included) is via
std:: namespace.
All the uses of sqrt should be converted to std::sqrt, otherwise compilers
with strictly conforming STLs (like SunCC -stlport4) will not be able to
compile.
(suggested patch attached)
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6052> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC