Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add std:: to isfinite in ImathFun.cpp #368

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

cary-ilm
Copy link
Member

Should hopefully address #367

Signed-off-by: Cary Phillips <cary@ilm.com>
Copy link
Contributor

@meshula meshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The std prefix is correct when using <cmath>

@cary-ilm cary-ilm merged commit edb64a8 into AcademySoftwareFoundation:main Feb 14, 2024
24 checks passed
cary-ilm added a commit to cary-ilm/Imath that referenced this pull request Feb 16, 2024
@barracuda156
Copy link
Contributor

@meshula @cary-ilm Thank you for addressing the issue!

There are two other cases in the same file:

float succf(float f) IMATH_NOEXCEPT
{
    return isfinite(f) ?
            std::nextafter(f, std::numeric_limits<float>::infinity()) : f;
}

float predf(float f) IMATH_NOEXCEPT
{
    return isfinite(f) ?
            std::nextafter(f, -std::numeric_limits<float>::infinity()) : f;
}

So at the moment it still fails:

/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)
      |     ^~~~~~~~
make[2]: *** [src/Imath/CMakeFiles/Imath.dir/ImathFun.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

Once those are fixed in the likewise manner, the build succeeds.

barracuda156 added a commit to barracuda156/Imath that referenced this pull request Feb 19, 2024
barracuda156 added a commit to barracuda156/Imath that referenced this pull request Feb 19, 2024
A follow-up to AcademySoftwareFoundation#368
Fixes: AcademySoftwareFoundation#367

Signed-off-by: Sergey Fedorov <vital.had@gmail.com>
cary-ilm pushed a commit that referenced this pull request Feb 20, 2024
A follow-up to #368
Fixes: #367

Signed-off-by: Sergey Fedorov <vital.had@gmail.com>
cary-ilm pushed a commit to cary-ilm/Imath that referenced this pull request Feb 21, 2024
cary-ilm added a commit to cary-ilm/Imath that referenced this pull request Feb 27, 2024
cary-ilm pushed a commit to cary-ilm/Imath that referenced this pull request Feb 27, 2024
cary-ilm added a commit that referenced this pull request Feb 27, 2024
Signed-off-by: Cary Phillips <cary@ilm.com>
cary-ilm pushed a commit that referenced this pull request Feb 27, 2024
A follow-up to #368
Fixes: #367

Signed-off-by: Sergey Fedorov <vital.had@gmail.com>
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Mar 3, 2024
## Version 3.1.11 (February 28, 2024)

Patch release with small build fix:

- Add explicit `std::` namespace for `isfinite` in `ImathFun.cpp`

This release also introduces the practice of signing release artifacts
via [sigstore](https://www.sigstore.dev).

### Merged Pull Requests
* \[[#371](AcademySoftwareFoundation/Imath#371]
ImathFun.cpp: add std:: to isfinite in remaining cases (#371)
* \[[#369](AcademySoftwareFoundation/Imath#369]
Add workflow to sign release artifacts with Sigstore
* \[[#368](AcademySoftwareFoundation/Imath#368]
Add std:: to isfinite in ImathFun.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants