Boost C++ Libraries: Ticket #6056: units/test_output: unqualified sqrt() fails to compile on SunCC/SunOS https://svn.boost.org/trac10/ticket/6056 <p> Compiling Boost/units test_output on SunOS with SunCC: </p> <pre class="wiki">] 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. </pre><p> The standard math header included here - <strong>&lt;cmath&gt;</strong> - does not inject math functions into the global namespace. The only standard way to use these functions (pow included) is via std:: namespace. </p> <p> 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. </p> <p> std::pow works fine with all the compilers I tried (SunCC, g++). </p> <p> (suggested patch attached) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6056 Trac 1.4.3 Fedor Sergeev <Fedor.Sergeev@…> Tue, 25 Oct 2011 11:02:26 GMT <link>https://svn.boost.org/trac10/ticket/6056#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6056#comment:1</guid> <description> <p> Doh... pilot error. Is there a way to change bug summary? </p> <p> Should read: "unqualified POW() fails to compile on SunCC/SunOS" </p> </description> <category>Ticket</category> </item> <item> <author>Fedor Sergeev <Fedor.Sergeev@…></author> <pubDate>Tue, 25 Oct 2011 11:03:46 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/6056 https://svn.boost.org/trac10/ticket/6056 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">diffs</span> </li> </ul> <p> patch for std::pow </p> Ticket