[Boost-bugs] [Boost C++ Libraries] #6056: units/test_output: unqualified sqrt() fails to compile on SunCC/SunOS

Subject: [Boost-bugs] [Boost C++ Libraries] #6056: units/test_output: unqualified sqrt() fails to compile on SunCC/SunOS
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-10-25 10:59:36


#6056: units/test_output: unqualified sqrt() fails to compile on SunCC/SunOS
------------------------------------------------------+---------------------
 Reporter: Fedor Sergeev <Fedor.Sergeev@…> | Owner: matthiasschabel
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: units
  Version: Boost 1.47.0 | Severity: Problem
 Keywords: SunCC |
------------------------------------------------------+---------------------
 Compiling Boost/units test_output on SunOS with SunCC:

 {{{
 ] sunCC -library=stlport4 -I../ ../libs/units/test/test_output.cpp
 "../libs/units/test/test_output.cpp", line 242: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 242: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 336: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 336: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 384: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 384: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 393: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 393: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 394: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 394: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 395: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 395: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 396: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 396: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 397: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 397: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 413: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 413: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 414: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 414: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 415: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 415: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 416: Error: The function "pow"
 must have a prototype.
 "../libs/units/test/test_output.cpp", line 416: Error: The function "pow"
 must have a prototype.
 24 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 (pow included) is via std:: namespace.

 All the uses of pow should be converted to std::pow, otherwise compilers
 with strictly conforming standard headers (like SunCC) will not be able to
 compile.

 std::pow works fine with all the compilers I tried (SunCC, g++).

 (suggested patch attached)

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6056>
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