Subject: [Boost-bugs] [Boost C++ Libraries] #6055: unqualified sqrt() fails to compile on SunCC/SunOS
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-10-25 10:34:51
#6055: unqualified sqrt() fails to compile on SunCC/SunOS
------------------------------------------------------+---------------------
Reporter: Fedor Sergeev <Fedor.Sergeev@â¦> | Owner: guwi17
Type: Bugs | Status: new
Milestone: To Be Determined | Component: uBLAS
Version: Boost 1.47.0 | Severity: Problem
Keywords: SunCC |
------------------------------------------------------+---------------------
Compiling uBlas' test_complex_norms on SunOS with SunCC:
{{{
] sunCC -library=stlport4 -I../
../libs/numeric/ublas/test/test_complex_norms.cpp
"../libs/numeric/ublas/test/test_complex_norms.cpp", line 37: Error: The
function "sqrt" must have a prototype.
"../libs/numeric/ublas/test/test_complex_norms.cpp", line 37: Error: The
function "sqrt" must have a prototype.
"../libs/numeric/ublas/test/test_complex_norms.cpp", line 65: Error: The
function "sqrt" must have a prototype.
"../libs/numeric/ublas/test/test_complex_norms.cpp", line 65: Error: The
function "sqrt" must have a prototype.
4 Error(s) detected.
}}}
The standard math header included here - <cmath> - does not inject math
functions into the global namespace. 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.
std::sqrt works fine with all the compilers I tried (SunCC, g++).
(suggested patch attached)
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6055> 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