Skip to content

Conversation

pps83
Copy link
Contributor

@pps83 pps83 commented May 27, 2025

No description provided.

@pps83
Copy link
Contributor Author

pps83 commented May 27, 2025

I get these warnings:

[3/9] Building CXX object CMakeFiles/common.dir/src/SplitsInfo.cpp.obj
In file included from D:/work-pps/src/SplitsInfo.cpp:1:
In file included from D:/work-pps/../boost_1_88_0/boost/multiprecision/cpp_int.hpp:19:
In file included from D:/work-pps/../boost_1_88_0/boost/multiprecision/number.hpp:12:
In file included from D:/work-pps/../boost_1_88_0/boost/multiprecision/detail/generic_interconvert.hpp:12:
In file included from D:/work-pps/../boost_1_88_0/boost/multiprecision/detail/default_ops.hpp:4067:
D:/work-pps/../boost_1_88_0/boost/multiprecision/detail/no_et_ops.hpp:458:79: warning: unused variable 'precision_guard' [-Wunused-variable]
  458 |          detail::scoped_default_precision<multiprecision::number<B, et_off> > precision_guard(a, b);
      |                                                                               ^~~~~~~~~~~~~~~
D:/work-pps/src/SplitsInfo.cpp:18:39: note: in instantiation of function template specialization 'boost::multiprecision::operator*<boost::multiprecision::backends::cpp_int_backend<128, 128, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>, unsigned long long>' requested here
   18 |         uint128_t x = uint128_t(from) * to_m;
      |                                       ^
In file included from D:/work-pps/src/SplitsInfo.cpp:1:
In file included from D:/work-pps/../boost_1_88_0/boost/multiprecision/cpp_int.hpp:19:
In file included from D:/work-pps/../boost_1_88_0/boost/multiprecision/number.hpp:12:
In file included from D:/work-pps/../boost_1_88_0/boost/multiprecision/detail/generic_interconvert.hpp:12:
D:/work-pps/../boost_1_88_0/boost/multiprecision/detail/default_ops.hpp:3975:1: warning: unused variable 'precision_guard' [-Wunused-variable]
 3975 | BINARY_OP_FUNCTOR(gcd, number_kind_integer)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/work-pps/../boost_1_88_0/boost/multiprecision/detail/default_ops.hpp:3669:82: note: expanded from macro 'BINARY_OP_FUNCTOR'
 3669 |       detail::scoped_default_precision<multiprecision::number<Backend, et_off> > precision_guard(arg, a);                                                                                                                                                  \
      |                                                                                  ^~~~~~~~~~~~~~~
D:/work-pps/src/SplitsInfo.cpp:20:23: note: in instantiation of function template specialization 'boost::multiprecision::gcd<boost::multiprecision::backends::cpp_int_backend<128, 128, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>>' requested here
   20 |         uint128_t z = gcd(x, y);
      |                       ^
In file included from D:/work-pps/src/SplitsInfo.cpp:1:
In file included from D:/work-pps/../boost_1_88_0/boost/multiprecision/cpp_int.hpp:19:
In file included from D:/work-pps/../boost_1_88_0/boost/multiprecision/number.hpp:12:
In file included from D:/work-pps/../boost_1_88_0/boost/multiprecision/detail/generic_interconvert.hpp:12:
In file included from D:/work-pps/../boost_1_88_0/boost/multiprecision/detail/default_ops.hpp:4067:
D:/work-pps/../boost_1_88_0/boost/multiprecision/detail/no_et_ops.hpp:141:79: warning: unused variable 'precision_guard' [-Wunused-variable]
  141 |          detail::scoped_default_precision<multiprecision::number<B, et_off> > precision_guard(a, b);
      |                                                                               ^~~~~~~~~~~~~~~
D:/work-pps/src/SplitsInfo.cpp:21:27: note: in instantiation of function template specialization 'boost::multiprecision::operator/<boost::multiprecision::backends::cpp_int_backend<128, 128, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>>' requested here
   21 |         from = uint64_t(x / z);
      |                           ^

this is sample code:

#include <boost/multiprecision/cpp_int.hpp>
#include <utility>
#include <string_view>
#include <stdint.h>

std::pair<uint64_t, uint64_t> from_string(const std::string_view& s);

std::pair<int, int> parse_splits(std::string_view split_from, std::string_view split_to)
{
    using namespace boost::multiprecision;
    auto [from, from_m] = from_string(split_from);
    auto [to, to_m] = from_string(split_to);
    if (from_m != 1 || to_m != 1)
    {
        uint128_t x = uint128_t(from) * to_m;
        uint128_t y = uint128_t(to) * from_m;
        uint128_t z = gcd(x, y);
        from = uint64_t(x / z);
        to = uint64_t(y / z);
    }
    return {int(from), int(to)};
}

I compile it with c++23 -Wall

@pps83
Copy link
Contributor Author

pps83 commented May 27, 2025

precision_guard is created in many places, it's too much mess to mark it unused for each var. Making struct [[maybe_unused]] seems to be working

Copy link

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.1%. Comparing base (eef4acf) to head (7c7add2).
Report is 51 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop    #691     +/-   ##
=========================================
+ Coverage     94.1%   94.1%   +0.1%     
=========================================
  Files          279     280      +1     
  Lines        28979   29074     +95     
=========================================
+ Hits         27253   27349     +96     
+ Misses        1726    1725      -1     
Files with missing lines Coverage Δ
include/boost/multiprecision/detail/precision.hpp 98.6% <ø> (ø)

... and 9 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eef4acf...7c7add2. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jzmaddock
Copy link
Collaborator

CI Failures are unrelated, will investigate separately.

@jzmaddock jzmaddock merged commit a7094d2 into boostorg:develop May 28, 2025
77 of 80 checks passed
@pps83 pps83 deleted the develop-scoped_default_precision branch May 28, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants