Opened 8 years ago

#10986 new Bugs

Missing std:: qualifier for rand in test_triangular.cpp

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

Description

Compiling libs/numeric/ublas/test/test_triangular.cpp on Solaris 11.2 with Oracle Solaris Studio12.4 compiler with -library=stlport4, we see

"../libs/numeric/ublas/test/test_triangular.cpp", line 49: Error: The function "rand" must have a prototype.

"../libs/numeric/ublas/test/test_triangular.cpp", line 51: Error: The function "rand" must have a prototype.

"../libs/numeric/ublas/test/test_triangular.cpp", line 48: Error: The function "rand" must have a prototype.

3 Error(s) detected.

The rand() function needs to be qualified with std::.

diff ./test_triangular.cpp ./test_triangular.cpp_orig

3,5d2 < #include <cstdlib>

< < 51,52c48,49 < b(i) = std::rand() % 10; < double main = -10 + std::rand() % 20 ; ---

b(i) = rand() % 10; double main = -10 + rand() % 20 ;

54c51 < double side = -10 + std::rand() % 20 ; ---

double side = -10 + rand() % 20 ;

Change History (0)

Note: See TracTickets for help on using tickets.