[Debian-med-packaging] Bug#1034369: C++ help needed (Was: Bug#1034369: libcereal: autopkgtest regression on non x86: cc1plus: all warnings being treated as errors)

Andreas Tille andreas at an3as.eu
Fri Apr 14 06:46:04 BST 2023


Control: tags -1 help

Hi,

I guess the fix will boil down to a type casting in this line

  https://salsa.debian.org/med-team/libcereal/-/blob/master/unittests/map.hpp#L65

     o_esplmap.insert({random_value<char>(gen),  { random_value<int>(gen), random_value<int>(gen) }});

unfortunately my C++ knowledge is too limited to know whether it is
really that simple nor how exactly this line needs to be fixed.  The fix
should be tested at least on arm64 (since the test passes on amd64).

Any help would be welcome
    Andreas.

Am Thu, Apr 13, 2023 at 08:00:27PM +0200 schrieb Paul Gevers:
> 
> https://ci.debian.net/data/autopkgtest/testing/arm64/libc/libcereal/32116422/log.gz
> 
> [ 25%] Building CXX object unittests/CMakeFiles/test_map.dir/map.cpp.o
> In file included from
> /tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.cpp:28:
> /tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp: In instantiation of ‘void test_map() [with IArchive = cereal::BinaryInputArchive; OArchive = cereal::BinaryOutputArchive]’:
> /tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.cpp:34:68: required from here
> /tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp:65:43: error: narrowing conversion of ‘random_value<char>(gen)’ from ‘std::enable_if<true, char>::type’ {aka ‘char’} to ‘signed char’ [-Werror=narrowing]
>    65 |       o_esplmap.insert({random_value<char>(gen),  { random_value<int>(gen), random_value<int>(gen) }});
>       |                         ~~~~~~~~~~~~~~~~~~^~~~~
> /tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp: In instantiation of ‘void test_map() [with IArchive = cereal::PortableBinaryInputArchive; OArchive = cereal::PortableBinaryOutputArchive]’:
> /tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.cpp:39:84: required from here
> /tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp:65:43: error: narrowing conversion of ‘random_value<char>(gen)’ from ‘std::enable_if<true, char>::type’ {aka ‘char’} to ‘signed char’ [-Werror=narrowing]
> /tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp: In instantiation of ‘void test_map() [with IArchive = cereal::XMLInputArchive; OArchive = cereal::XMLOutputArchive]’:
> /tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.cpp:44:62: required from here
> /tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp:65:43: error: narrowing conversion of ‘random_value<char>(gen)’ from ‘std::enable_if<true, char>::type’ {aka ‘char’} to ‘signed char’ [-Werror=narrowing]
> /tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp: In instantiation of ‘void test_map() [with IArchive = cereal::JSONInputArchive;
> OArchive = cereal::JSONOutputArchive]’:
> /tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.cpp:49:64: required from here
> /tmp/autopkgtest-lxc.nn60praz/downtmp/autopkgtest_tmp/unittests/map.hpp:65:43: error: narrowing conversion of ‘random_value<char>(gen)’ from ‘std::enable_if<true, char>::type’ {aka ‘char’} to ‘signed char’ [-Werror=narrowing]
> cc1plus: all warnings being treated as errors
> make[2]: *** [unittests/CMakeFiles/test_map.dir/build.make:76:
> unittests/CMakeFiles/test_map.dir/map.cpp.o] Error 1
> make[1]: *** [CMakeFiles/Makefile2:556:
> unittests/CMakeFiles/test_map.dir/all] Error 2
> make: *** [Makefile:146: all] Error 2




> _______________________________________________
> Debian-med-packaging mailing list
> Debian-med-packaging at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-packaging


-- 
http://fam-tille.de



More information about the Debian-med-packaging mailing list