Skip to content

Commit

Permalink
Merge pull request #276 from ckormanyos/clang_modulus_with_integral
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos authored May 18, 2022
2 parents ada039d + 09d1ac1 commit 965728d
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/wide_integer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,40 @@ jobs:
echo "ls ./wide_integer.exe"
ls -la ./wide_integer.exe
./wide_integer.exe
gcc-12-clang-14:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
standard: [ c++11, c++14, c++17, c++20, c++2b ]
compiler: [ g++-12, clang++-14 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: update-tools
run: sudo apt install g++-12 clang-14
- name: clone-submods-bootstrap-headers-boost-develop
run: |
git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
cd ../boost-root
git submodule update --init tools
git submodule update --init libs/config
git submodule update --init libs/multiprecision
./bootstrap.sh
./b2 headers
- name: gcc-12-clang-14
run: |
grep BOOST_VERSION ../boost-root/boost/version.hpp
echo "compile ./wide_integer.exe"
${{ matrix.compiler }} -v
${{ matrix.compiler }} -finline-functions -m64 -O3 -Werror -Wall -Wextra -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=${{ matrix.standard }} -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -I. -I../boost-root -pthread -lpthread test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example000a_builtin_convert.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp -o wide_integer.exe
echo "ls ./wide_integer.exe"
ls -la ./wide_integer.exe
./wide_integer.exe
gcc-clang-10_up:
runs-on: ubuntu-20.04
defaults:
Expand Down
9 changes: 9 additions & 0 deletions boost/multiprecision/uintwide_t_backend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wrestrict"
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#pragma GCC diagnostic push
Expand Down Expand Up @@ -1059,6 +1064,10 @@
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic pop
#endif

#if (BOOST_VERSION < 108000)
#if defined(__GNUC__)
#pragma GCC diagnostic pop
Expand Down
9 changes: 9 additions & 0 deletions examples/example008a_miller_rabin_prime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wrestrict"
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#pragma GCC diagnostic push
Expand Down Expand Up @@ -204,6 +209,10 @@ auto main() -> int // NOLINT(bugprone-exception-escape)
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic pop
#endif

#if (BOOST_VERSION < 108000)
#if defined(__GNUC__)
#pragma GCC diagnostic pop
Expand Down
9 changes: 9 additions & 0 deletions test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wrestrict"
#endif

#if (BOOST_VERSION < 107900)
#include <boost/lexical_cast.hpp>
#endif
Expand Down Expand Up @@ -525,6 +530,10 @@ auto main() -> int // NOLINT(bugprone-exception-escape)
return (result_is_ok ? 0 : -1);
}

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic pop
#endif

#if (BOOST_VERSION < 107900)
#if defined(__GNUC__)
#pragma GCC diagnostic pop
Expand Down
9 changes: 9 additions & 0 deletions test/test_uintwide_t_boost_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wrestrict"
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#pragma GCC diagnostic push
Expand Down Expand Up @@ -123,6 +128,10 @@ auto math::wide_integer::test_uintwide_t_boost_backend() -> bool
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic pop
#endif

#if (BOOST_VERSION < 108000)
#if defined(__GNUC__)
#pragma GCC diagnostic pop
Expand Down
9 changes: 9 additions & 0 deletions test/test_uintwide_t_boost_backend_via_test_arithmetic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wrestrict"
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#pragma GCC diagnostic push
Expand Down Expand Up @@ -74,6 +79,10 @@ auto main() -> int
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic pop
#endif

#if (BOOST_VERSION < 108000)
#if defined(__GNUC__)
#pragma GCC diagnostic pop
Expand Down
9 changes: 9 additions & 0 deletions test/test_uintwide_t_edge_cases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wrestrict"
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#pragma GCC diagnostic push
Expand Down Expand Up @@ -173,6 +178,10 @@ auto math::wide_integer::test_uintwide_t_edge_cases() -> bool
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic pop
#endif

#if (BOOST_VERSION < 108000)
#if defined(__GNUC__)
#pragma GCC diagnostic pop
Expand Down
9 changes: 9 additions & 0 deletions test/test_uintwide_t_float_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wrestrict"
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#pragma GCC diagnostic push
Expand Down Expand Up @@ -279,6 +284,10 @@ auto math::wide_integer::test_uintwide_t_float_convert() -> bool
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic pop
#endif

#if (BOOST_VERSION < 108000)
#if defined(__GNUC__)
#pragma GCC diagnostic pop
Expand Down
9 changes: 9 additions & 0 deletions test/test_uintwide_t_int_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wrestrict"
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#pragma GCC diagnostic push
Expand Down Expand Up @@ -191,6 +196,10 @@ auto math::wide_integer::test_uintwide_t_int_convert() -> bool
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic pop
#endif

#if (BOOST_VERSION < 108000)
#if defined(__GNUC__)
#pragma GCC diagnostic pop
Expand Down
9 changes: 9 additions & 0 deletions test/test_uintwide_t_n_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wrestrict"
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#pragma GCC diagnostic push
Expand Down Expand Up @@ -150,6 +155,10 @@
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic pop
#endif

#if (BOOST_VERSION < 108000)
#if defined(__GNUC__)
#pragma GCC diagnostic pop
Expand Down
9 changes: 9 additions & 0 deletions test/test_uintwide_t_n_binary_ops_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wrestrict"
#endif

#if (BOOST_VERSION < 108000)
#if (defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__)
#pragma GCC diagnostic push
Expand Down Expand Up @@ -55,6 +60,10 @@ auto test_uintwide_t_n_binary_ops_base::my_gen() -> test_uintwide_t_n_binary_ops
#endif
#endif

#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
#pragma GCC diagnostic pop
#endif

#if (BOOST_VERSION < 108000)
#if defined(__GNUC__)
#pragma GCC diagnostic pop
Expand Down

0 comments on commit 965728d

Please sign in to comment.