openexr icon indicating copy to clipboard operation
openexr copied to clipboard

exrmetrics: compilation error

Open 0-wiz-0 opened this issue 1 year ago • 2 comments

While updating the openexr package in pkgsrc, I noticed the following compilation error on NetBSD-10.99.12/amd64 with gcc 12.4.0:

/scratch/graphics/openexr/work/openexr-3.3.0/src/bin/exrmetrics/exrmetrics.cpp: In function 'void exrmetrics(const char*, const char*, int, Imf_3_3::Compression, float, int)':
/scratch/graphics/openexr/work/openexr-3.3.0/src/bin/exrmetrics/exrmetrics.cpp:486:10: error: 'isinf' was not declared in this scope; did you mean 'std::isinf'?
  486 |     if (!isinf (level) && level >= -1)
      |          ^~~~~
      |          std::isinf
In file included from /usr/pkg/include/Imath/ImathMath.h:16,
                 from /usr/pkg/include/Imath/ImathVec.h:17,
                 from /usr/pkg/include/Imath/ImathBox.h:16,
                 from /scratch/graphics/openexr/work/openexr-3.3.0/src/lib/OpenEXR/ImfFrameBuffer.h:21,
                 from /scratch/graphics/openexr/work/openexr-3.3.0/src/lib/OpenEXR/ImfDeepFrameBuffer.h:11,
                 from /scratch/graphics/openexr/work/openexr-3.3.0/src/bin/exrmetrics/exrmetrics.cpp:10:
/usr/include/g++/cmath:605:5: note: 'std::isinf' declared here
  605 |     isinf(_Tp __x)
      |     ^~~~~

Following the compiler's suggestion fixes the build:

--- src/bin/exrmetrics/exrmetrics.cpp.orig      2024-09-26 23:34:32.000000000 +0000
+++ src/bin/exrmetrics/exrmetrics.cpp
@@ -482,7 +482,7 @@ exrmetrics (
     }
     else { compression = outHeader.compression (); }

-    if (!isinf (level) && level >= -1)
+    if (!std::isinf (level) && level >= -1)
     {
         switch (outHeader.compression ())
         {

0-wiz-0 avatar Oct 19 '24 11:10 0-wiz-0

fix lgtm, thanks; do you want to submit or PR, or simply have us apply it?

meshula avatar Oct 24 '24 05:10 meshula

I've made a patch but then noticed that I have to sign a contribution document, which is quite overkill for such an easy patch - so please just commit it yourself. Thank you!

0-wiz-0 avatar Oct 24 '24 08:10 0-wiz-0