Skip to content

Commit

Permalink
Handle more syntax and run coverity
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos committed Sep 29, 2024
1 parent 3704f7a commit a174ecc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 2 additions & 0 deletions math/wide_integer/uintwide_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,12 @@
using local_destination_value_type = typename iterator_detail::iterator_traits<DestinationIterator>::value_type;
#if (defined(__GNUC__) && (__GNUC__ > 9))
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
*dest++ = static_cast<local_destination_value_type>(*first++);
#if (defined(__GNUC__) && (__GNUC__ > 9))
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif
}

Expand Down
35 changes: 34 additions & 1 deletion test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// make gcov -f make_gcov_01_generic.gmk --jobs=8 MY_ALL_COV=0 MY_BOOST_ROOT=/mnt/c/boost/boost_1_85_0 MY_CC=g++

// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer
// PATH=/home/chris/coverity/cov-analysis-linux64-2023.6.2/bin:$PATH
// PATH=/home/chris/coverity/cov-analysis-linux64-2023.12.2/bin:$PATH
// cov-build --dir cov-int g++ -finline-functions -march=native -mtune=native -O3 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -std=c++14 -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -DWIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL -I. -I/mnt/c/boost/boost_1_85_0 -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 examples/example000a_builtin_convert.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.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 examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe
// tar caf wide-integer.bz2 cov-int

Expand Down Expand Up @@ -109,6 +109,39 @@ constexpr std::size_t test_uintwide_t_n_binary_ops_4_by_4_cases = std::uint32_t(
constexpr std::size_t test_uintwide_t_n_binary_ops_4_by_4_cases = std::uint32_t(1UL << 9U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
#endif

auto test_uintwide_t_small_bits() -> bool;
auto test_uintwide_t_boost_backend() -> bool;
auto test_uintwide_t_examples() -> bool;
auto test_uintwide_t_edge_cases() -> bool;
auto test_uintwide_t_float_convert() -> bool;
auto test_uintwide_t_int_convert() -> bool;
auto test_uintwide_t_spot_values() -> bool;
auto test_uintwide_t_0000024() -> bool;
auto test_uintwide_t_0000048() -> bool;
auto test_uintwide_t_0000064() -> bool;
auto test_uintwide_t_0000064_signed() -> bool;
auto test_uintwide_t_0000096() -> bool;
auto test_uintwide_t_0000128() -> bool;
auto test_uintwide_t_0000256() -> bool;
#if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)
auto test_uintwide_t_0000256_limb_type_uint64_t() -> bool;
#endif
auto test_uintwide_t_0000512() -> bool;
auto test_uintwide_t_0000512_signed() -> bool;
auto test_uintwide_t_0001024() -> bool;
auto test_uintwide_t_0002048() -> bool;
auto test_uintwide_t_0008192() -> bool;
#if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)
auto test_uintwide_t_0008192_limb_type_uint64_t() -> bool;
#endif
auto test_uintwide_t_0012288() -> bool;
auto test_uintwide_t_0032768() -> bool;
auto test_uintwide_t_0065536_alloc() -> bool;
auto test_uintwide_t_0008192_by_0012288() -> bool;
auto test_uintwide_t_0012288_by_0008192() -> bool;
auto test_uintwide_t_0000032_by_0000032_4_by_4() -> bool;
auto test_uintwide_t_0000064_by_0000064_4_by_4() -> bool;

auto test_uintwide_t_small_bits() -> bool
{
std::cout << "running: test_uintwide_t_small_bits" << std::endl;
Expand Down

0 comments on commit a174ecc

Please sign in to comment.