mirror of
https://github.com/OPM/opm-upscaling.git
synced 2025-02-25 18:45:23 -06:00
Specify namespace of math functions to avoid name clashes
In the 4.6.x range of GNU compilers, the cmath header include math.h, adding isinf() and isnan() to the global namespace as well as std. When used in if statements, there is then an ambiguity between the std version which returns bool and the global function which returns int; for more details see: <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48891> If we qualify the functions explicitly with their namespace, this error goes away.
This commit is contained in:
parent
8bb70d9300
commit
c4d99e3ea1
@ -553,7 +553,7 @@ int main(int varnum, char** vararg)
|
||||
}
|
||||
|
||||
// Check for saneness of Ptestvalue:
|
||||
if (isnan(Ptestvalue) | isinf(Ptestvalue)) {
|
||||
if (std::isnan(Ptestvalue) || std::isinf(Ptestvalue)) {
|
||||
cerr << "ERROR: Ptestvalue was inf or nan" << endl;
|
||||
break; // Jump out of while-loop, just print out the results
|
||||
// up to now and exit the program
|
||||
|
@ -713,7 +713,7 @@ int main(int varnum, char** vararg)
|
||||
}
|
||||
|
||||
// Check for saneness of Ptestvalue:
|
||||
if (isnan(Ptestvalue) | isinf(Ptestvalue)) {
|
||||
if (std::isnan(Ptestvalue) || std::isinf(Ptestvalue)) {
|
||||
if (isMaster) cerr << "ERROR: Ptestvalue was inf or nan" << endl;
|
||||
break; // Jump out of while-loop, just print out the results
|
||||
// up to now and exit the program
|
||||
|
@ -1187,7 +1187,7 @@ int main(int varnum, char** vararg)
|
||||
}
|
||||
|
||||
// Check for saneness of Ptestvalue:
|
||||
if (isnan(Ptestvalue) | isinf(Ptestvalue)) {
|
||||
if (std::isnan(Ptestvalue) || std::isinf(Ptestvalue)) {
|
||||
if (isMaster) cerr << "ERROR: Ptestvalue was inf or nan" << endl;
|
||||
break; // Jump out of while-loop, just print out the results
|
||||
// up to now and exit the program
|
||||
|
@ -1081,7 +1081,7 @@ int main(int varnum, char** vararg)
|
||||
}
|
||||
|
||||
// Check for saneness of fracFlowRatioTestvalue
|
||||
if (isnan(fracFlowRatioTestvalue) || isinf(fracFlowRatioTestvalue)) {
|
||||
if (std::isnan(fracFlowRatioTestvalue) || std::isinf(fracFlowRatioTestvalue)) {
|
||||
if (isMaster) cerr << "ERROR: fracFlowRatioTestvalue was inf or nan." << endl;
|
||||
break; // Jump out out while-loop, just print the results up to now and exit
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user