Scribo does not compile with GCC 8
I cannot compile Olena in a toolchain based on g++ 8.2.0:
make[5]: Entering directory `/home/h9/kawu438b/src/ocrd_olena/olena-git/build/scribo/src/contest/hdlac-2011'
g++ -DHAVE_CONFIG_H -I../../../../../scribo -I../../../../../milena -I/sw/installed/GraphicsMagick/1.3.28-foss-2018a/include/GraphicsMagick -DNDEBUG -O2 -Wall -W -Wno-unused-local-typedefs -pipe -MT content_in_hdoc_hdlac-content_in_hdoc_hdlac.o -MD -MP -MF .deps/content_in_hdoc_hdlac-content_in_hdoc_hdlac.Tpo -c -o content_in_hdoc_hdlac-content_in_hdoc_hdlac.o `test -f 'content_in_hdoc_hdlac.cc' || echo '../../../../../scribo/src/contest/hdlac-2011/'`content_in_hdoc_hdlac.cc
In file included from ../../../../../scribo/scribo/toolchain/text_in_doc_preprocess.hh:39,
from ../../../../../scribo/src/contest/hdlac-2011/content_in_hdoc_hdlac.cc:38:
../../../../../scribo/scribo/binarization/sauvola_ms.hh: In function ‘mln::image2d<mln::value::int_u<8> > scribo::binarization::internal::compute_t_n_and_e_2(const mln::image2d<mln::value::int_u<8> >&, mln::image2d<mln::value::int_u<8> >&, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, const mln::image2d<mln::util::couple<double, double> >&)’:
../../../../../scribo/scribo/binarization/sauvola_ms.hh:277:61: warning: ‘void* memset(void*, int, size_t)’ writing to an object of non-trivial type ‘struct mln::value::int_u<8>’; use assignment instead [-Wclass-memaccess]
std::memset(ptr(l), i, ratio * sizeof(mln_value_(I)));
^
In file included from ../../../../../milena/mln/math/abs.hh:37,
from ../../../../../milena/mln/norm/linfty.hh:37,
from ../../../../../milena/mln/core/window.hh:50,
from ../../../../../milena/mln/core/w_window.hh:41,
from ../../../../../milena/mln/core/image/image1d.hh:562,
from ../../../../../milena/mln/make/image.hh:37,
from ../../../../../milena/mln/core/image/image2d.hh:709,
from ../../../../../scribo/src/contest/hdlac-2011/content_in_hdoc_hdlac.cc:33:
../../../../../milena/mln/value/int_u.hh:129:12: note: ‘struct mln::value::int_u<8>’ declared here
struct int_u
^~~~~
In file included from ../../../../../scribo/scribo/toolchain/text_in_doc_preprocess.hh:39,
from ../../../../../scribo/src/contest/hdlac-2011/content_in_hdoc_hdlac.cc:38:
../../../../../scribo/scribo/binarization/sauvola_ms.hh:299:61: warning: ‘void* memset(void*, int, size_t)’ writing to an object of non-trivial type ‘struct mln::value::int_u<8>’; use assignment instead [-Wclass-memaccess]
std::memset(ptr(l), i, ratio * sizeof(mln_value_(I)));
^
In file included from ../../../../../milena/mln/math/abs.hh:37,
from ../../../../../milena/mln/norm/linfty.hh:37,
from ../../../../../milena/mln/core/window.hh:50,
from ../../../../../milena/mln/core/w_window.hh:41,
from ../../../../../milena/mln/core/image/image1d.hh:562,
from ../../../../../milena/mln/make/image.hh:37,
from ../../../../../milena/mln/core/image/image2d.hh:709,
from ../../../../../scribo/src/contest/hdlac-2011/content_in_hdoc_hdlac.cc:33:
../../../../../milena/mln/value/int_u.hh:129:12: note: ‘struct mln::value::int_u<8>’ declared here
struct int_u
^~~~~
In file included from ../../../../../scribo/scribo/primitive/extract/non_text_hdoc.hh:46,
from ../../../../../scribo/scribo/toolchain/internal/content_in_hdoc_functor.hh:45,
from ../../../../../scribo/scribo/toolchain/content_in_hdoc.hh:33,
from ../../../../../scribo/src/contest/hdlac-2011/content_in_hdoc_hdlac.cc:37:
../../../../../scribo/scribo/debug/logger.hh: In instantiation of ‘void scribo::debug::internal::logger_::log_image(scribo::debug::Level, const mln::Image<I>&, const char*) [with I = mln::image2d<bool>]’:
../../../../../scribo/scribo/toolchain/internal/content_in_hdoc_functor.hh:262:4: required from ‘scribo::document<typename mln::trait::ch_value<I, mln::value::int_u<30> >::ret> scribo::toolchain::internal::content_in_hdoc_functor<I>::operator()(const mln::Image<J>&, const mln::Image<I>&) [with J = mln::image2d<mln::value::rgb<8> >; I = mln::image2d<bool>; typename mln::trait::ch_value<I, mln::value::int_u<30> >::ret = mln::image2d<mln::value::int_u<30> >]’
../../../../../scribo/scribo/toolchain/content_in_hdoc.hh:95:55: required from ‘scribo::document<typename mln::trait::ch_value<I, mln::value::int_u<30> >::ret> scribo::toolchain::content_in_hdoc(const mln::Image<I>&, const mln::Image<J>&, bool, bool, bool, bool, const string&) [with I = mln::image2d<mln::value::rgb<8> >; J = mln::image2d<bool>; typename mln::trait::ch_value<I, mln::value::int_u<30> >::ret = mln::image2d<mln::value::int_u<30> >; std::__cxx11::string = std::__cxx11::basic_string<char>]’
../../../../../scribo/src/contest/hdlac-2011/content_in_hdoc_hdlac.cc:127:38: required from here
../../../../../scribo/scribo/debug/logger.hh:414:2: error: call of overloaded ‘log_image_dispatch(bool, const mln::Image<mln::image2d<bool> >&, const char*&)’ is ambiguous
log_image_dispatch(V(), ima, name);
^~~~~~~~~~~~~~~~~~
../../../../../scribo/scribo/debug/logger.hh:178:7: note: candidate: ‘void scribo::debug::internal::logger_::log_image_dispatch(const typename I::value&, const mln::Image<I>&, const char*) [with I = mln::image2d<bool>; typename I::value = bool]’
void log_image_dispatch(const mln_value(I)&,
^~~~~~~~~~~~~~~~~~
../../../../../scribo/scribo/debug/logger.hh:467:7: note: candidate: ‘void scribo::debug::internal::logger_::log_image_dispatch(const bool&, const mln::Image<I>&, const char*) [with I = mln::image2d<bool>]’
logger_::log_image_dispatch(const bool&, const Image<I>& ima, const char *name)
^~~~~~~
../../../../../scribo/scribo/debug/logger.hh: In instantiation of ‘void scribo::debug::internal::logger_::log_image(scribo::debug::Level, const mln::Image<I>&, const char*) [with I = mln::image2d<mln::value::rgb<8> >]’:
../../../../../scribo/scribo/toolchain/internal/content_in_hdoc_functor.hh:354:4: required from ‘scribo::document<typename mln::trait::ch_value<I, mln::value::int_u<30> >::ret> scribo::toolchain::internal::content_in_hdoc_functor<I>::operator()(const mln::Image<J>&, const mln::Image<I>&) [with J = mln::image2d<mln::value::rgb<8> >; I = mln::image2d<bool>; typename mln::trait::ch_value<I, mln::value::int_u<30> >::ret = mln::image2d<mln::value::int_u<30> >]’
../../../../../scribo/scribo/toolchain/content_in_hdoc.hh:95:55: required from ‘scribo::document<typename mln::trait::ch_value<I, mln::value::int_u<30> >::ret> scribo::toolchain::content_in_hdoc(const mln::Image<I>&, const mln::Image<J>&, bool, bool, bool, bool, const string&) [with I = mln::image2d<mln::value::rgb<8> >; J = mln::image2d<bool>; typename mln::trait::ch_value<I, mln::value::int_u<30> >::ret = mln::image2d<mln::value::int_u<30> >; std::__cxx11::string = std::__cxx11::basic_string<char>]’
../../../../../scribo/src/contest/hdlac-2011/content_in_hdoc_hdlac.cc:127:38: required from here
../../../../../scribo/scribo/debug/logger.hh:414:2: error: call of overloaded ‘log_image_dispatch(V, const mln::Image<mln::image2d<mln::value::rgb<8> > >&, const char*&)’ is ambiguous
log_image_dispatch(V(), ima, name);
^~~~~~~~~~~~~~~~~~
../../../../../scribo/scribo/debug/logger.hh:178:7: note: candidate: ‘void scribo::debug::internal::logger_::log_image_dispatch(const typename I::value&, const mln::Image<I>&, const char*) [with I = mln::image2d<mln::value::rgb<8> >; typename I::value = mln::value::rgb<8>]’
void log_image_dispatch(const mln_value(I)&,
^~~~~~~~~~~~~~~~~~
../../../../../scribo/scribo/debug/logger.hh:460:7: note: candidate: ‘void scribo::debug::internal::logger_::log_image_dispatch(const rgb8&, const mln::Image<I>&, const char*) [with I = mln::image2d<mln::value::rgb<8> >; mln::value::rgb8 = mln::value::rgb<8>]’
logger_::log_image_dispatch(const value::rgb8&, const Image<I>& ima, const char *name)
^~~~~~~
make[5]: *** [content_in_hdoc_hdlac-content_in_hdoc_hdlac.o] Error 1
Is there anything we can do to taim the modern GCC? (I have already tried setting -std=
to c++98
, c++03
, c++11
, or c++14
, but nothing changes.)