#67403 closed defect (fixed)

imath, openexr broken with gcc: missing header for PRIx64 etc.

Reported by: barracuda156 Owned by: barracuda156
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), mascguy (Christopher Nielsen)
Port: imath, openexr

Description

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp: In function 'void testf(float, bool)':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:49:23: error: expected ')' before 'PRIx32'
   49 |     printf ("f %.9g %" PRIx32 "\n", f, bit_cast<uint32_t> (f));
      |            ~          ^~~~~~~
      |                       )
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:20:1: note: 'PRIx32' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?
   19 | #include <inttypes.h>
  +++ |+#include <cinttypes>
   20 | 
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:50:24: error: expected ')' before 'PRIx32'
   50 |     printf ("sf %.9g %" PRIx32 "\n", sf, bit_cast<uint32_t> (sf));
      |            ~           ^~~~~~~
      |                        )
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:50:25: note: 'PRIx32' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?
   50 |     printf ("sf %.9g %" PRIx32 "\n", sf, bit_cast<uint32_t> (sf));
      |                         ^~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:51:24: error: expected ')' before 'PRIx32'
   51 |     printf ("pf %.9g %" PRIx32 "\n", pf, bit_cast<uint32_t> (pf));
      |            ~           ^~~~~~~
      |                        )
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:51:25: note: 'PRIx32' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?
   51 |     printf ("pf %.9g %" PRIx32 "\n", pf, bit_cast<uint32_t> (pf));
      |                         ^~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:52:25: error: expected ')' before 'PRIx32'
   52 |     printf ("spf %.9g %" PRIx32 "\n", spf, bit_cast<uint32_t> (spf));
      |            ~            ^~~~~~~
      |                         )
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:52:26: note: 'PRIx32' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?
   52 |     printf ("spf %.9g %" PRIx32 "\n", spf, bit_cast<uint32_t> (spf));
      |                          ^~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:53:25: error: expected ')' before 'PRIx32'
   53 |     printf ("psf %.9g %" PRIx32 "\n", psf, bit_cast<uint32_t> (psf));
      |            ~            ^~~~~~~
      |                         )
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:53:26: note: 'PRIx32' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?
   53 |     printf ("psf %.9g %" PRIx32 "\n", psf, bit_cast<uint32_t> (psf));
      |                          ^~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp: In function 'void testd(double, bool)':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:90:28: error: expected ')' before 'PRIx64'
   90 |     printf ("d   %0.18lg %" PRIx64 "\n", d, bit_cast<uint64_t> (d));
      |            ~               ^~~~~~~
      |                            )
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:90:29: note: 'PRIx64' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?
   90 |     printf ("d   %0.18lg %" PRIx64 "\n", d, bit_cast<uint64_t> (d));
      |                             ^~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:91:28: error: expected ')' before 'PRIx64'
   91 |     printf ("sd  %0.18lg %" PRIx64 "\n", sd, bit_cast<uint64_t> (sd));
      |            ~               ^~~~~~~
      |                            )
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:91:29: note: 'PRIx64' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?
   91 |     printf ("sd  %0.18lg %" PRIx64 "\n", sd, bit_cast<uint64_t> (sd));
      |                             ^~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:92:28: error: expected ')' before 'PRIx64'
   92 |     printf ("pd  %0.18lg %" PRIx64 "\n", pd, bit_cast<uint64_t> (pd));
      |            ~               ^~~~~~~
      |                            )
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:92:29: note: 'PRIx64' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?
   92 |     printf ("pd  %0.18lg %" PRIx64 "\n", pd, bit_cast<uint64_t> (pd));
      |                             ^~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:93:28: error: expected ')' before 'PRIx64'
   93 |     printf ("spd %0.18lg %" PRIx64 "\n", spd, bit_cast<uint64_t> (spd));
      |            ~               ^~~~~~~
      |                            )
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:93:29: note: 'PRIx64' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?
   93 |     printf ("spd %0.18lg %" PRIx64 "\n", spd, bit_cast<uint64_t> (spd));
      |                             ^~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:94:28: error: expected ')' before 'PRIx64'
   94 |     printf ("psd %0.18lg %" PRIx64 "\n", psd, bit_cast<uint64_t> (psd));
      |            ~               ^~~~~~~
      |                            )
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_openexr/imath/work/imath-3.1.7/src/ImathTest/testFun.cpp:94:29: note: 'PRIx64' is defined in header '<cinttypes>'; did you forget to '#include <cinttypes>'?
   94 |     printf ("psd %0.18lg %" PRIx64 "\n", psd, bit_cast<uint64_t> (psd));
      |                             ^~~~~~
[ 47%] Building CXX object src/ImathTest/CMakeFiles/ImathTest.dir/testInvert.cpp.o

Change History (13)

comment:1 Changed 19 months ago by barracuda156

Port: openexr added
Summary: imath is broken with gcc: missing header for PRIx64 etc.imath, openexr broken with gcc: missing header for PRIx64 etc.

comment:2 Changed 19 months ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

sudo port -v destroot imath configure.compiler=macports-gcc-13 worked for me on macOS Ventura.
So I assume the issue is a mixture of older OS and/or older GCC compiler.
Could you please post the clean main.log?

comment:3 in reply to:  2 Changed 19 months ago by barracuda156

Replying to MarcusCalhoun-Lopez:

sudo port -v destroot imath configure.compiler=macports-gcc-13 worked for me on macOS Ventura.
So I assume the issue is a mixture of older OS and/or older GCC compiler.
Could you please post the clean main.log?

It is not even GCC-specific, it is just a wrong header included. See: https://github.com/macports/macports-ports/commit/2a477ac3558ce6342ecb151f1c683657e7558349

comment:4 Changed 19 months ago by barracuda156

I will make a PR to fix all three.

comment:5 Changed 19 months ago by kencu (Ken)

It's likely not the wrong header. It's just that older systems didn't define this by default:

#define __STDC_FORMAT_MACROS 1

whereas newer systems do (10.7+, as I recal). We have added this define in dozens of ports to fix this issue. It's a trivial little thing to add.

Version 0, edited 19 months ago by kencu (Ken) (next)

comment:6 in reply to:  5 Changed 19 months ago by barracuda156

Replying to kencu:

It's likely not the wrong header. It's just that older systems didn't define this by default:

#define __STDC_FORMAT_MACROS 1

whereas newer systems do (10.7+, as I recal). We have added this define in dozens of ports to fix this issue. It's a trivial little thing to add.

Yes, sure, __STDC_FORMAT_MACROS should be added, I remember those after you pointed at that earlier.

comment:7 Changed 19 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added
Owner: changed from mascguy to barracuda156
Summary: imath, openexr broken with gcc: missing header for PRIx64 etc.imath, openexr: broken with gcc: missing header for PRIx64 etc.

comment:8 Changed 19 months ago by barracuda156

Summary: imath, openexr: broken with gcc: missing header for PRIx64 etc.imath, openexr broken with gcc: missing header for PRIx64 etc.

Eh, have a bigger issue there, it uses libdispatch for Apple, need to switch it to generic fallback for ppc and < 10.6.

comment:9 Changed 19 months ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Thank you for noticing these issues.
There is a pull request that attempts to fix the problems.

comment:10 in reply to:  9 Changed 19 months ago by barracuda156

Replying to MarcusCalhoun-Lopez:

Thank you for noticing these issues.
There is a pull request that attempts to fix the problems.

For one thing, we need to include Rosetta:

if {${os.major} < 10 || (${os.major} == 10  && ${build_arch} eq "ppc")}  {

I have no idea if full posix semaphores work in Darwin. I did this instead: https://github.com/AcademySoftwareFoundation/openexr/issues/1405#issue-1706895953

comment:11 Changed 19 months ago by barracuda156

Why I did not yet make a PR is this: https://github.com/AcademySoftwareFoundation/openexr/issues/1404

We need to fix Big endian.

comment:12 Changed 18 months ago by barracuda156

This can be closed.

comment:13 in reply to:  12 Changed 18 months ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: assignedclosed

Replying to barracuda156:

This can be closed.

Sounds good, thanks for the heads-up!

Note: See TracTickets for help on using tickets.