Freeimage fails to build with GCC 6.1.1.
Source/LibRawLite/./internal/dcraw_common.cpp: In member function ‘void LibRaw::vng_interpolate()’:
Source/LibRawLite/./internal/dcraw_common.cpp:4545:3: error: narrowing conversion of ‘128’ from ‘int’ to ‘signed char’ inside { } [-Wnarrowing]
}, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 };
^
Source/LibRawLite/./internal/dcraw_common.cpp:4545:3: error: narrowing conversion of ‘136’ from ‘int’ to ‘signed char’ inside { } [-Wnarrowing]
Makefile.gnu:64: recipe for target 'Source/LibRawLite/./internal/dcraw_common.o' failed
make[1]: *** [Source/LibRawLite/./internal/dcraw_common.o] Error 1
Explicit casts to signed char should be added in the array initialiser for values that fall outside of -128 -- 127 range to make GCC happy when compiling in C++14 mode (the default now in GCC 6.x).
Alternatively, compiling FreeImage in C++98 mode (-std=c++98) also fixes the issue.
Hi, I'm pretty new new to programming and I'm not too clear on what needs to be done to fix the script:
You have e.,g. 0x80 = 128 and 0x88 = 136 inside terms[].
Here's my package (32-bit freeimage for 64-bit ArchLinux) that builds successfully (see PKGBUILD for build commands). Besides that bug there are also some string concatenating issues (see gcc5.patch).
High Davorin, thanks for getting back to me so quickly and for sharing your patch. I don't see any attachments or links though. If SourceForge's attachment system isn't working, could you email it to me? mo.mashi [at] gmail.com
Hey Davoring, as per your recommendation, I replaced:
<freeimage3170.zip>/FreeImage/Source/LibRawLite/internal/dcraw_common.cpp (4523-4546)</freeimage3170.zip>
with
It's compiling great now but I was just wondering if what I did was sound (with regards to setting the values of terms[] via static cast of an signed int). I also couldn't do the casting of terms[] if I declared it as a static constant signed char array. Should I try to convert it somehow to a constant array after the casting is done in order to avoid any run-time bugs. Would you know how I could do that?
Last edit: Fadi R 2017-02-25
Closed in release 3.18.0 (new LibRaw library)
Please open a new bug if your problem persist.