Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

narrowing error on arm64 #787

Open
mr-c opened this issue Apr 14, 2023 · 2 comments
Open

narrowing error on arm64 #787

mr-c opened this issue Apr 14, 2023 · 2 comments

Comments

@mr-c
Copy link
Contributor

mr-c commented Apr 14, 2023

In Debian, we run the unit tests post-installation.

https://salsa.debian.org/med-team/libcereal/-/blob/master/debian/tests/run-unit-test#L18

cmake -DONLY_TEST=on -DSKIP_PORTABILITY_TEST=on -DBUILD_SANDBOX=True .
make

Full log: https://ci.debian.net/data/autopkgtest/testing/arm64/libc/libcereal/32116422/log.gz using G++ 12.2.0

[ 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
@tillea
Copy link

tillea commented Apr 14, 2023

You might like to check out the patch suggested by Aaron M. Ucko

@AzothAmmo
Copy link
Contributor

Should be fixed by #764 - I will try to get a new tag out in the near future after fixing various CI and merging a few more PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants