Opened 8 years ago

#10913 new Bugs

Missing std:: qualifier for pow call in units/test/test_output.cpp

Reported by: Aparna Kumta <aparna.kumta@…> Owned by: Matthias Schabel
Milestone: To Be Determined Component: units
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

Compiling test_output.cpp with Oracle Solaris Studio 12.4 compiler on Solaris 11.2 with -library=stlport4, we see

"../libs/units/test/test_output.cpp", line 262: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 262: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 356: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 356: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 404: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 404: 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. "../libs/units/test/test_output.cpp", line 417: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 417: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 418: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 418: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 419: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 419: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 437: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 437: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 438: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 438: Error: The function "pow" must have a prototype. "../libs/units/test/test_output.cpp", line 439: Error: The function "pow" must have a prototype.

The call to pow is unqualified and the following change resolves the issue. % diff ./test_output.cpp ./test_output.cpp_orig 262c262 < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 10) * byte_base_unit::unit_type(), "1024 b"); ---

BOOST_UNITS_TEST_OUTPUT(pow(2., 10) * byte_base_unit::unit_type(), "1024 b");

356c356 < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 10) * byte_base_unit::unit_type(), "1.024 kilobyte"); ---

BOOST_UNITS_TEST_OUTPUT(pow(2., 10) * byte_base_unit::unit_type(), "1.024 kilobyte");

404c404 < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 10) * byte_base_unit::unit_type(), "1.024 kb"); ---

BOOST_UNITS_TEST_OUTPUT(pow(2., 10) * byte_base_unit::unit_type(), "1.024 kb");

413,419c413,419 < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 20) * byte_base_unit::unit_type(), "1 Mib"); < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 30) * byte_base_unit::unit_type(), "1 Gib"); < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 40) * byte_base_unit::unit_type(), "1 Tib"); < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 50) * byte_base_unit::unit_type(), "1 Pib"); < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 60) * byte_base_unit::unit_type(), "1 Eib"); < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 70) * byte_base_unit::unit_type(), "1 Zib"); < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 80) * byte_base_unit::unit_type(), "1 Yib"); ---

BOOST_UNITS_TEST_OUTPUT(pow(2., 20) * byte_base_unit::unit_type(), "1 Mib"); BOOST_UNITS_TEST_OUTPUT(pow(2., 30) * byte_base_unit::unit_type(), "1 Gib"); BOOST_UNITS_TEST_OUTPUT(pow(2., 40) * byte_base_unit::unit_type(), "1 Tib"); BOOST_UNITS_TEST_OUTPUT(pow(2., 50) * byte_base_unit::unit_type(), "1 Pib"); BOOST_UNITS_TEST_OUTPUT(pow(2., 60) * byte_base_unit::unit_type(), "1 Eib"); BOOST_UNITS_TEST_OUTPUT(pow(2., 70) * byte_base_unit::unit_type(), "1 Zib"); BOOST_UNITS_TEST_OUTPUT(pow(2., 80) * byte_base_unit::unit_type(), "1 Yib");

437,442c437,442 < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 32) *byte_base_unit::unit_type(), "4 gibibyte"); < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 41) *byte_base_unit::unit_type(), "2 tebibyte"); http://en.wikipedia.org/wiki/Tebibyte < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 50) *byte_base_unit::unit_type(), "1 pebibyte"); < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 60) *byte_base_unit::unit_type(), "1 exbibyte"); < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 70) *byte_base_unit::unit_type(), "1 zebibyte"); < BOOST_UNITS_TEST_OUTPUT(std::pow(2., 80) *byte_base_unit::unit_type(), "1 yobibyte"); ---

BOOST_UNITS_TEST_OUTPUT(pow(2., 32) *byte_base_unit::unit_type(), "4 gibibyte"); BOOST_UNITS_TEST_OUTPUT(pow(2., 41) *byte_base_unit::unit_type(), "2 tebibyte"); http://en.wikipedia.org/wiki/Tebibyte BOOST_UNITS_TEST_OUTPUT(pow(2., 50) *byte_base_unit::unit_type(), "1 pebibyte"); BOOST_UNITS_TEST_OUTPUT(pow(2., 60) *byte_base_unit::unit_type(), "1 exbibyte"); BOOST_UNITS_TEST_OUTPUT(pow(2., 70) *byte_base_unit::unit_type(), "1 zebibyte"); BOOST_UNITS_TEST_OUTPUT(pow(2., 80) *byte_base_unit::unit_type(), "1 yobibyte");

Change History (0)

Note: See TracTickets for help on using tickets.