Opened 11 years ago
Closed 10 years ago
#6052 closed Bugs (fixed)
unqualified sqrt() fails with SunCC
Reported by: | Owned by: | Lucanus Simonson | |
---|---|---|---|
Milestone: | To Be Determined | Component: | polygon |
Version: | Boost 1.47.0 | Severity: | Problem |
Keywords: | Cc: |
Description
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)
Attachments (1)
Change History (3)
by , 11 years ago
comment:2 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
patch for std::sqrt