lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] New CI breakage due to gcc 12 updates


From: Vadim Zeitlin
Subject: [lmi] New CI breakage due to gcc 12 updates
Date: Sun, 24 Jul 2022 01:28:36 +0200

 Hello,

 The latest CI build failed because Debian Sid has just updated to gcc 12.
The simplest fix would be to switch to using gcc-11 explicitly, and I might
do this if I don't manage to solve the problems quickly, but I think it's
worth solving them nevertheless.

 There are 3 of them and the first one looks easy enough:

---------------------------------- >8 --------------------------------------
/opt/lmi/third_party/src/cgicc/Cgicc.cpp:45:37: error: 'template<class _Arg, 
class _Result> struct std::unary_function' is deprecated 
[-Werror=deprecated-declarations]
   45 | class FE_nameCompare : public STDNS unary_function<FormEntry, bool>
      |                                     ^~~~~~~~~~~~~~
In file included from /usr/include/c++/12/functional:49,
                 from /opt/lmi/third_party/src/cgicc/Cgicc.cpp:27:
...
---------------------------------- >8 --------------------------------------

To fix this normally I would just stop inheriting from unary_function<>,
but this involves modifying third party code, so perhaps you'd prefer to
suppress the deprecation warning for it? In fact, I've never really
understood if CGI-related code was still used or not (and by "still" I mean
as far back as in 2005 when I first looked at it), so perhaps the time has
come to just drop it?

 The second problem is a bit more interesting:

---------------------------------- >8 --------------------------------------
In file included from /usr/include/c++/12/bits/char_traits.h:46,
                 from /usr/include/c++/12/ios:40,
                 from /usr/include/c++/12/istream:38,
                 from /usr/include/c++/12/sstream:38,
                 from /__w/lmi/lmi/assert_lmi.hpp:28,
                 from /__w/lmi/lmi/md5sum.cpp:24:
/usr/include/c++/12/bits/stl_construct.h: In instantiation of 'constexpr 
decltype (::new(void*(0)) _Tp) std::construct_at(_Tp*, _Args&& ...) [with _Tp = 
md5sum_for_file; _Args = {__cxx11::basic_string<char, char_traits<char>, 
allocator<char> >, __cxx11::basic_string<char, char_traits<char>, 
allocator<char> >, md5_file_mode&}; decltype (::new(void*(0)) _Tp) = 
md5sum_for_file*]':
/usr/include/c++/12/bits/alloc_traits.h:518:21:   required from 'static 
constexpr void std::allocator_traits<std::allocator<_CharT> 
>::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = md5sum_for_file; 
_Args = {std::__cxx11::basic_string<char, std::char_traits<char>, 
std::allocator<char> >, std::__cxx11::basic_string<char, 
std::char_traits<char>, std::allocator<char> >, md5_file_mode&}; _Tp = 
md5sum_for_file; allocator_type = std::allocator<md5sum_for_file>]'
/usr/include/c++/12/bits/vector.tcc:117:30:   required from 'constexpr 
std::vector<_Tp, _Alloc>::reference std::vector<_Tp, 
_Alloc>::emplace_back(_Args&& ...) [with _Args = 
{std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> 
>, std::__cxx11::basic_string<char, std::char_traits<char>, 
std::allocator<char> >, md5_file_mode&}; _Tp = md5sum_for_file; _Alloc = 
std::allocator<md5sum_for_file>; reference = md5sum_for_file&]'
/__w/lmi/lmi/md5sum.cpp:100:32:   required from here
/usr/include/c++/12/bits/stl_construct.h:95:14: error: noexcept-expression 
evaluates to 'false' because of a call to 
'md5sum_for_file::md5sum_for_file(fs::path&&, std::string&&, md5_file_mode)' 
[-Werror=noexcept]
   95 |     noexcept(noexcept(::new((void*)0) _Tp(std::declval<_Args>()...)))
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /__w/lmi/lmi/md5sum.cpp:26:
/__w/lmi/lmi/md5sum.hpp:50:5: note: but 
'md5sum_for_file::md5sum_for_file(fs::path&&, std::string&&, md5_file_mode)' 
does not throw; perhaps it should be declared 'noexcept'
   50 |     md5sum_for_file(fs::path&& path, std::string&& sum, md5_file_mode 
mode)
      |     ^~~~~~~~~~~~~~~
---------------------------------- >8 --------------------------------------

It appears that using emplace_back() requires the corresponding ctor to not
throw in C++20, which is news to me, to be honest, but we should make the
ctor noexcept anyhow, of course.

 The third problem is the most mysterious one. I'm not going to paste the
full error message here because it's too long but the relevant excerpts
are:

---------------------------------- >8 --------------------------------------
In constructor 'constexpr std::__cxx11::basic_string<_CharT, _Traits, 
_Alloc>::_Alloc_hider::_Alloc_hider(std::__cxx11::basic_string<_CharT, _Traits, 
_Alloc>::pointer, _Alloc&&) [with _CharT = char; _Traits = 
std::char_traits<char>; _Alloc = std::allocator<char>]',
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, 
_Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, 
_Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = 
std::allocator<char>]' at /usr/include/c++/12/bits/basic_string.h:540:9,
...
inlined from 'void CensusView::update_class_names()' at 
/__w/lmi/lmi/census_view.cpp:1170:21:
/usr/include/c++/12/bits/basic_string.h:204:43: error: null pointer dereference 
[-Werror=null-dereference]
  204 |         : allocator_type(std::move(__a)), _M_p(__dat) { }
      |                                           ^~~~~~~~~~~
---------------------------------- >8 --------------------------------------

which doesn't make sense to me because we are not using any null pointers
here. I'll try to look at it a.s.a.p. but just wanted to already give you
an advance warning about this if you happen to build lmi using gcc-12
yourself.

 Regards,
VZ

Attachment: pgpvHaTeigob0.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]