ImageMagick / libfpx

4 stars 6 forks source link

Build fails with C++17 compiler #5

Closed orlitzky closed 1 year ago

orlitzky commented 1 year ago

When using a newer compiler (such as clang-16), the build fails:

In file included from color.cpp:15:
In file included from ./fpx_color.h:28:
./npixel.h:107:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    register unsigned32 newColor = *((unsigned32 *)(&pix));

This was reported to us in Gentoo bug #896246. The solution is pretty simple: delete register.

orlitzky commented 1 year ago

In fact one of our users already wrote a patch: https://github.com/gentoo/gentoo/pull/32758/files#diff-a929c5b8bee9569a579126f33e7f4f8f928526f2a0c366b6af7284603279c99e

It would be better to fix it here though.

dlemstra commented 1 year ago

We accept pull requests here so feel free to do that next time. I just pushed a patch that removes the register keyword.

orlitzky commented 1 year ago

Yeah, sorry about all of the drive-by reports. I noticed them languishing on the Gentoo bug tracker (assigned to nobody) and at least wanted to make sure they were reported upstream. Thanks a lot for the fix.