Fail to compile with Exiv2 0.27.2
[6/23] Compiling C++ object 'gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o'.
FAILED: gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o
clang++ -B/home/lantw44/.local/bin -Igexiv2/1a6c516@@gexiv2@sha -Igexiv2 -I../../source/gexiv2/gexiv2 -Igexiv2/.. -I../../source/gexiv2/gexiv2/.. -I/home/lantw44/gnome/devinstall/include/glib-2.0 -I/home/lantw44/gnome/devinstall/lib/glib-2.0/include -I/usr/local/lib/libffi-3.2.1/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++11 -O2 -g -march=corei7 -B/home/lantw44/.local/bin -g3 -Og -gz -fdebug-macro -fPIC -pthread -MD -MQ 'gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o' -MF 'gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o.d' -o 'gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o' -c ../../source/gexiv2/gexiv2/gexiv2-metadata.cpp
../../source/gexiv2/gexiv2/gexiv2-metadata.cpp:90:26: error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned long') to 'long' in initializer list [-Wc++11-narrowing]
Exiv2::DataBuf b{rcount};
^~~~~~
../../source/gexiv2/gexiv2/gexiv2-metadata.cpp:90:26: note: insert an explicit cast to silence this issue
Exiv2::DataBuf b{rcount};
^~~~~~
static_cast<long>( )
1 error generated.
In Exiv2 0.27.2, the constructor is declared as explicit DataBuf(long size);
, and passing size_t
(which is unsigned) is not allowed.