xtensor-stack / xtensor-blas

BLAS extension to xtensor
BSD 3-Clause "New" or "Revised" License
155 stars 54 forks source link

warnings from clang-12 in tests #215

Open yurivict opened 2 years ago

yurivict commented 2 years ago
/disk-samsung/freebsd-ports/math/xtensor-blas/work/xtensor-blas-0.20.0/test/test_lapack.cpp:166:40: warning: implicit conversion changes signedness: 'int' to 'xt::xaccessible<xt::xarray_container<xt::uvector<double>, xt::layout_type::column_major, xt::svector<unsigned long, 4, std::allocator<unsigned long>, true>>>::size_type' (aka 'unsigned long') [-Wsign-conversion]
          EXPECT_NEAR(x_expected[i], x[i], 5e-16);
                                     ~ ^
/usr/local/include/gtest/gtest.h:2162:29: note: expanded from macro 'EXPECT_NEAR'
                      val1, val2, abs_error)
                            ^~~~
/usr/local/include/gtest/gtest_pred_impl.h:219:40: note: expanded from macro 'EXPECT_PRED_FORMAT3'
  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
                                       ^~
/usr/local/include/gtest/gtest_pred_impl.h:202:48: note: expanded from macro 'GTEST_PRED_FORMAT3_'
  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
                                               ^~
/usr/local/include/gtest/gtest_pred_impl.h:77:52: note: expanded from macro 'GTEST_ASSERT_'
  if (const ::testing::AssertionResult gtest_ar = (expression)) \
                                                   ^~~~~~~~~~
/disk-samsung/freebsd-ports/math/xtensor-blas/work/xtensor-blas-0.20.0/test/test_lapack.cpp:166:34: warning: implicit conversion changes signedness: 'int' to 'xt::xconst_accessible<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long, 4, std::allocator<unsigned long>, true>>>::size_type' (aka 'unsigned long') [-Wsign-conversion]
          EXPECT_NEAR(x_expected[i], x[i], 5e-16);
                      ~~~~~~~~~~ ^
/usr/local/include/gtest/gtest.h:2162:23: note: expanded from macro 'EXPECT_NEAR'
                      val1, val2, abs_error)
                      ^~~~
/usr/local/include/gtest/gtest_pred_impl.h:219:36: note: expanded from macro 'EXPECT_PRED_FORMAT3'
  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
                                   ^~
/usr/local/include/gtest/gtest_pred_impl.h:202:44: note: expanded from macro 'GTEST_PRED_FORMAT3_'
  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
                                           ^~
/usr/local/include/gtest/gtest_pred_impl.h:77:52: note: expanded from macro 'GTEST_ASSERT_'
  if (const ::testing::AssertionResult gtest_ar = (expression)) \
                                                   ^~~~~~~~~~
/disk-samsung/freebsd-ports/math/xtensor-blas/work/xtensor-blas-0.20.0/test/test_lapack.cpp:165:27: warning: comparison of integers of different signs: 'int' and 'const xt::svector<unsigned long, 4, std::allocator<unsigned long>, true>::value_type' (aka 'const unsigned long') [-Wsign-compare]
        for (int i = 0; i < x_expected.shape()[0]; ++i) {
                        ~ ^ ~~~~~~~~~~~~~~~~~~~~~
/disk-samsung/freebsd-ports/math/xtensor-blas/work/xtensor-blas-0.20.0/test/test_lapack.cpp:186:45: warning: implicit conversion changes signedness: 'int' to 'xt::xaccessible<xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::column_major>>::size_type' (aka 'unsigned long') [-Wsign-conversion]
          EXPECT_DOUBLE_EQ(x_expected[i], x[i]);
                                          ~ ^
/usr/local/include/gtest/gtest.h:2150:29: note: expanded from macro 'EXPECT_DOUBLE_EQ'
                      val1, val2)
                            ^~~~
/usr/local/include/gtest/gtest_pred_impl.h:164:40: note: expanded from macro 'EXPECT_PRED_FORMAT2'
  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
                                       ^~
/usr/local/include/gtest/gtest_pred_impl.h:149:43: note: expanded from macro 'GTEST_PRED_FORMAT2_'
  GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
                                          ^~
/usr/local/include/gtest/gtest_pred_impl.h:77:52: note: expanded from macro 'GTEST_ASSERT_'
  if (const ::testing::AssertionResult gtest_ar = (expression)) \
                                                   ^~~~~~~~~~
/disk-samsung/freebsd-ports/math/xtensor-blas/work/xtensor-blas-0.20.0/test/test_lapack.cpp:186:39: warning: implicit conversion changes signedness: 'int' to 'xt::xconst_accessible<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long, 4, std::allocator<unsigned long>, true>>>::size_type' (aka 'unsigned long') [-Wsign-conversion]
          EXPECT_DOUBLE_EQ(x_expected[i], x[i]);
                           ~~~~~~~~~~ ^
/usr/local/include/gtest/gtest.h:2150:23: note: expanded from macro 'EXPECT_DOUBLE_EQ'
                      val1, val2)
                      ^~~~
/usr/local/include/gtest/gtest_pred_impl.h:164:36: note: expanded from macro 'EXPECT_PRED_FORMAT2'
  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
                                   ^~
/usr/local/include/gtest/gtest_pred_impl.h:149:39: note: expanded from macro 'GTEST_PRED_FORMAT2_'
  GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
                                      ^~
/usr/local/include/gtest/gtest_pred_impl.h:77:52: note: expanded from macro 'GTEST_ASSERT_'
  if (const ::testing::AssertionResult gtest_ar = (expression)) \
                                                   ^~~~~~~~~~
/disk-samsung/freebsd-ports/math/xtensor-blas/work/xtensor-blas-0.20.0/test/test_lapack.cpp:185:27: warning: comparison of integers of different signs: 'int' and 'const xt::svector<unsigned long, 4, std::allocator<unsigned long>, true>::value_type' (aka 'const unsigned long') [-Wsign-compare]
        for (int i = 0; i < x_expected.shape()[0]; ++i) {
                        ~ ^ ~~~~~~~~~~~~~~~~~~~~~
6 warnings generated.
james-d-mitchell commented 1 year ago

I think this was resolved by #226, maybe be good to close the issue? @SylvainCorlay @JohanMabille @wolfv