From 1dc582f6f65faf0db17585882d38f75e6738cca2 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 29 Nov 2023 20:49:00 -0800 Subject: [PATCH] Product fix: Avoid -Wsign-compare warnings in mdspan. mdspan(541,49): error: comparison of integers of different signs: 'index_type' (aka 'unsigned long long') and 'index_type' (aka 'int') [-Werror,-Wsign-compare] --- stl/inc/mdspan | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/inc/mdspan b/stl/inc/mdspan index d956cb2343..ecdd6e5884 100644 --- a/stl/inc/mdspan +++ b/stl/inc/mdspan @@ -538,7 +538,7 @@ public: if constexpr (extents_type::rank() > 0) { index_type _Prod = 1; for (size_t _Idx = 0; _Idx < extents_type::_Rank; ++_Idx) { - _STL_VERIFY(_Other.stride(_Idx) == _Prod, + _STL_VERIFY(_STD cmp_equal(_Other.stride(_Idx), _Prod), "For all r in the range [0, extents_type::rank()), other.stride(r) must be equal to " "extents().fwd-prod-of-extents(r) (N4950 [mdspan.layout.left.cons]/10.1)."); _Prod = static_cast(_Prod * this->_Exts.extent(_Idx)); @@ -690,7 +690,7 @@ public: if constexpr (extents_type::rank() > 0) { index_type _Prod = 1; for (size_t _Idx = extents_type::_Rank; _Idx-- > 0;) { - _STL_VERIFY(_Prod == _Other.stride(_Idx), + _STL_VERIFY(_STD cmp_equal(_Prod, _Other.stride(_Idx)), "For all r in the range [0, extents_type::rank()), other.stride(r) must be equal to " "extents().rev-prod-of-extents(r) (N4950 [mdspan.layout.right.cons]/10.1)."); _Prod = static_cast(_Prod * this->_Exts.extent(_Idx));