3.1.10 broken `isfinite`: `ImathFun.cpp: error: 'isfinite' was not declared in this scope; did you mean 'std::isfinite'?`
barracuda156 opened this issue · comments
I recall this has been fixed in OpenEXR
, but now apparently broken here by a recent commit 0e0f4a7
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_imath/imath/work/imath-3.1.10/src/Imath/ImathFun.cpp: In function 'float Imath_3_1::succf(float)':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_imath/imath/work/imath-3.1.10/src/Imath/ImathFun.cpp:13:12: error: 'isfinite' was not declared in this scope; did you mean 'std::isfinite'?
13 | return isfinite(f) ?
| ^~~~~~~~
| std::isfinite
In file included from /opt/local/include/LegacySupport/cmath:54,
from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_imath/imath/work/imath-3.1.10/src/Imath/ImathFun.cpp:7:
/opt/local/include/gcc13/c++/cmath:1138:5: note: 'std::isfinite' declared here
1138 | isfinite(_Tp __x)
| ^~~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_imath/imath/work/imath-3.1.10/src/Imath/ImathFun.cpp: In function 'float Imath_3_1::predf(float)':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_imath/imath/work/imath-3.1.10/src/Imath/ImathFun.cpp:19:12: error: 'isfinite' was not declared in this scope; did you mean 'std::isfinite'?
19 | return isfinite(f) ?
| ^~~~~~~~
| std::isfinite
/opt/local/include/gcc13/c++/cmath:1138:5: note: 'std::isfinite' declared here
1138 | isfinite(_Tp __x)
| ^~~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_imath/imath/work/imath-3.1.10/src/Imath/ImathFun.cpp: In function 'double Imath_3_1::succd(double)':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_imath/imath/work/imath-3.1.10/src/Imath/ImathFun.cpp:25:12: error: 'isfinite' was not declared in this scope; did you mean 'std::isfinite'?
25 | return isfinite(d) ?
| ^~~~~~~~
| std::isfinite
/opt/local/include/gcc13/c++/cmath:1138:5: note: 'std::isfinite' declared here
1138 | isfinite(_Tp __x)
| ^~~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_imath/imath/work/imath-3.1.10/src/Imath/ImathFun.cpp: In function 'double Imath_3_1::predd(double)':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_imath/imath/work/imath-3.1.10/src/Imath/ImathFun.cpp:31:12: error: 'isfinite' was not declared in this scope; did you mean 'std::isfinite'?
31 | return isfinite(d) ?
| ^~~~~~~~
| std::isfinite
/opt/local/include/gcc13/c++/cmath:1138:5: note: 'std::isfinite' declared here
1138 | isfinite(_Tp __x)
| ^~~~~~~~
make[2]: *** [src/Imath/CMakeFiles/Imath.dir/ImathFun.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
@kdt3rd Could you please take a look? I get a similar breakage here to an earlier one in OpenEXR
(which you have fixed there): AcademySoftwareFoundation/openexr#1412
Is it appropriate to prepend these with std::
here as well, as GCC suggests?
It's not clear which C++ standard Imath is intended to require, but std::isfinite
was added in C++11. In older C++, you should usually be able to use isfinite
if you #include <math.h>
since it's part of C99.
If requiring C++11 is the intent, then CMakeLists.txt
should declare that requirement by setting CMAKE_CXX_STANDARD
.