Skip to content

Commit

Permalink
Merge pull request #417 from ckormanyos/issue416
Browse files Browse the repository at this point in the history
Fix #416 via unsafe version lexicographical-cmp
  • Loading branch information
ckormanyos authored Jun 3, 2024
2 parents c5924dd + 1b519d0 commit dc733ea
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 26 deletions.
4 changes: 2 additions & 2 deletions boost/multiprecision/uintwide_t_backend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
Expand Down Expand Up @@ -1061,7 +1061,7 @@
} // namespace std

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic pop
#endif
#endif
Expand Down
4 changes: 2 additions & 2 deletions examples/example008a_miller_rabin_prime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
Expand Down Expand Up @@ -207,7 +207,7 @@ auto main() -> int // NOLINT(bugprone-exception-escape)
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic pop
#endif
#endif
Expand Down
9 changes: 5 additions & 4 deletions math/wide_integer/uintwide_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <string>
#endif
#include <type_traits>
#include <utility>

#if (defined(__clang__) && (__clang_major__ <= 9))
#define WIDE_INTEGER_NUM_LIMITS_CLASS_TYPE struct // NOLINT(cppcoreguidelines-macro-usage)
Expand Down Expand Up @@ -995,10 +996,10 @@
{
const size_type my_count = min_unsafe(lhs.size(), rhs.size());

b_result= std::lexicographical_compare(lhs.cbegin(),
lhs.cbegin() + my_count,
rhs.cbegin(),
rhs.cbegin() + my_count);
b_result = lexicographical_compare_unsafe(lhs.cbegin(),
lhs.cbegin() + my_count,
rhs.cbegin(),
rhs.cbegin() + my_count);
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/test_uintwide_t_boost_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
Expand Down Expand Up @@ -136,7 +136,7 @@ auto ::math::wide_integer::test_uintwide_t_boost_backend() -> bool
}

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic pop
#endif
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_uintwide_t_boost_backend_via_test_arithmetic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
Expand Down Expand Up @@ -78,7 +78,7 @@ auto main() -> int
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic pop
#endif
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_uintwide_t_edge_cases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
Expand Down Expand Up @@ -2624,7 +2624,7 @@ auto local_inf_ld() -> long double { return std::numeric_limits<long double>::in
// LCOV_EXCL_STOP

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic pop
#endif
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_uintwide_t_float_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
Expand Down Expand Up @@ -327,7 +327,7 @@ auto ::math::wide_integer::test_uintwide_t_float_convert() -> bool
}

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic pop
#endif
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_uintwide_t_int_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
Expand Down Expand Up @@ -210,7 +210,7 @@ auto ::math::wide_integer::test_uintwide_t_int_convert() -> bool
}

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic pop
#endif
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_uintwide_t_n_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
Expand Down Expand Up @@ -156,7 +156,7 @@
};

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic pop
#endif
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_uintwide_t_n_binary_ops_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
Expand All @@ -70,7 +70,7 @@ auto test_uintwide_t_n_binary_ops_base::my_gen() -> test_uintwide_t_n_binary_ops
}

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
#pragma GCC diagnostic pop
#endif
#endif
Expand Down
8 changes: 4 additions & 4 deletions wide_integer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(ProjectDir);C:\boost\boost_1_83_0;$(IncludePath)</IncludePath>
<IncludePath>$(ProjectDir);C:\boost\boost_1_85_0;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(ProjectDir);C:\boost\boost_1_84_0;$(IncludePath)</IncludePath>
<IncludePath>$(ProjectDir);C:\boost\boost_1_85_0;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(ProjectDir);C:\boost\boost_1_83_0;$(IncludePath)</IncludePath>
<IncludePath>$(ProjectDir);C:\boost\boost_1_85_0;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(ProjectDir);C:\boost\boost_1_84_0;$(IncludePath)</IncludePath>
<IncludePath>$(ProjectDir);C:\boost\boost_1_85_0;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down

0 comments on commit dc733ea

Please sign in to comment.