Subject: | Compilation failure (with newer c++ compilers) |
On newer systems (debian 10, ubuntu 18.04, fedora 28, freebsd 12+13) the compilation fails. On freebsd systems (clang++) it looks like this:
...
c++ -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy -D__ANSI__ -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -ISource/LibJPEG -ISource/LibPNG -ISource/LibTIFF4 -ISource/ZLib -ISource/LibOpenJPEG -ISource/OpenEXR -ISource/OpenEXR/Half -ISource/OpenEXR/Iex -ISource/OpenEXR/IlmImf -ISource/OpenEXR/IlmThread -ISource/OpenEXR/Imath -ISource/OpenEXR/IexMath -ISource/LibRawLite -ISource/LibRawLite/dcraw -ISource/LibRawLite/internal -ISource/LibRawLite/libraw -ISource/LibRawLite/src -ISource/LibWebP -ISource/LibJXR -ISource/LibJXR/common/include -ISource/LibJXR/image/sys -ISource/LibJXR/jxrgluelib -c Source/LibRawLite/./src/libraw_cxx.cpp -o Source/LibRawLite/./src/libraw_cxx.o
...
Source/LibRawLite/src/../internal/libraw_x3f.cpp:1249:19: error: non-constant-expression cannot be narrowed from type 'int' to 'int16_t' (aka 'short') in initializer list [-Wc++11-narrowing]
int16_t c[3] = {offset,offset,offset};
^~~~~~
...
Source/LibRawLite/src/../internal/libraw_x3f.cpp:1249:26: error: non-constant-expression cannot be narrowed from type 'int' to 'int16_t' (aka 'short') in initializer list [-Wc++11-narrowing]
int16_t c[3] = {offset,offset,offset};
^~~~~~
...
Source/LibRawLite/src/../internal/libraw_x3f.cpp:1249:33: error: non-constant-expression cannot be narrowed from type 'int' to 'int16_t' (aka 'short') in initializer list [-Wc++11-narrowing]
int16_t c[3] = {offset,offset,offset};
^~~~~~
...
And on linux systems (g++):
...
g++ -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy -D__ANSI__ -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -ISource/LibJPEG -ISource/LibPNG -ISource/LibTIFF4 -ISource/ZLib -ISource/LibOpenJPEG -ISource/OpenEXR -ISource/OpenEXR/Half -ISource/OpenEXR/Iex -ISource/OpenEXR/IlmImf -ISource/OpenEXR/IlmThread -ISource/OpenEXR/Imath -ISource/OpenEXR/IexMath -ISource/LibRawLite -ISource/LibRawLite/dcraw -ISource/LibRawLite/internal -ISource/LibRawLite/libraw -ISource/LibRawLite/src -ISource/LibWebP -ISource/LibJXR -ISource/LibJXR/common/include -ISource/LibJXR/image/sys -ISource/LibJXR/jxrgluelib -fPIC -c Source/LibRawLite/./internal/dcraw_common.cpp -o Source/LibRawLite/./internal/dcraw_common.o
...
Source/LibRawLite/./internal/dcraw_common.cpp:6940:97: error: call of overloaded 'powf64(int, int)' is ambiguous
10*(table_buf[iLensData+9]>>2) * powf64(4, (table_buf[iLensData+9] & 0x03)-2);
^
In file included from /usr/include/c++/8/cmath:45,
from /usr/include/c++/8/math.h:36,
from Source/LibRawLite/./internal/dcraw_common.cpp:24:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:140:1: note: candidate: '_Float64 powf64(_Float64, _Float64)'
__MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
^~~~~~~~~~~~~~
...
Source/LibRawLite/./internal/dcraw_common.cpp:7812:97: error: call of overloaded 'powf64(int, int)' is ambiguous
10*(table_buf[iLensData+9]>>2) * powf64(4, (table_buf[iLensData+9] & 0x03)-2);
^
In file included from /usr/include/c++/8/cmath:45,
from /usr/include/c++/8/math.h:36,
from Source/LibRawLite/./internal/dcraw_common.cpp:24:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:140:1: note: candidate: '_Float64 powf64(_Float64, _Float64)'
__MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
^~~~~~~~~~~~~~
...