boostorg / boostorg/boost

Remove unused variable warnings in `boost-mpi`.

Open
#1,015 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
8.6k
Forks
1.9k
Avg merge
39m
Merged PRs (30d)
2

Description

When compiling boost code on MacOS (with boost obtained by homebrew), I obtained the following warnings:
```
/opt/homebrew/Cellar/boost/1.87.0/include/boost/mpi/detail/request_handlers.hpp:220:39: warning: unused parameter 'comm' [-Wunused-parameter]
220 | serialized_data(communicator const& comm, packed_iarchive& ar) : m_archive(ar) {}

/opt/homebrew/Cellar/boost/1.87.0/include/boost/mpi/communicator.hpp:1424:71: warning: unused parameter 'primitive' [-Wunused-parameter]
1424 | std::vector& values, mpl::true_ primitive) const

/opt/homebrew/Cellar/boost/1.87.0/include/boost/mpi/communicator.hpp:1548:39: warning: unused parameter 'primitive' [-Wunused-parameter]
1548 | mpl::true_ primitive) const

/opt/homebrew/Cellar/boost/1.87.0/include/boost/mpi/communicator.hpp:1634:39: warning: unused parameter 'primitive' [-Wunused-parameter]
1634 | mpl::true_ primitive) const

/opt/homebrew/Cellar/boost/1.87.0/include/boost/mpi/collectives/broadcast.hpp:107:30: warning: unused parameter 'non_mpi_datatype' [-Wunused-parameter]
107 | mpl::false_ non_mpi_datatype)

/opt/homebrew/Cellar/boost/1.87.0/include/boost/mpi/collectives/reduce.hpp:81:33: warning: unused parameter 'op' [-Wunused-parameter]
81 | T* out_values, Op op, int root, mpl::false_ /*is_mpi_op*/,

/opt/homebrew/Cellar/boost/1.87.0/include/boost/mpi/collectives/reduce.hpp:96:71: warning: unused parameter 'op' [-Wunused-parameter]
96 | reduce_impl(const communicator& comm, const T* in_values, int n, Op op,

/opt/homebrew/Cellar/boost/1.87.0/include/boost/mpi/collectives/scan.hpp:68:16: warning: unused parameter 'op' [-Wunused-parameter]
68 | Op op, mpl::false_ /*is_mpi_op*/, mpl::true_ /*is_mpi_datatype*/)
```

The solution that I use is to add `[[maybe_unused]]`. Would that be acceptable for boost code? If so, I can create a PR for that.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.