Skip to content
Snippets Groups Projects
Commit 4596048a authored by Tobias Leibner's avatar Tobias Leibner
Browse files

use [[maybe_unused]] some more

parent dbecef6f
No related branches found
No related tags found
1 merge request!41Fix compilation with icc, several other changes
Pipeline #64883 failed
......@@ -125,7 +125,7 @@ private:
typedef FixedMap<key_imp, T, nin> ThisType;
std::string range_error_message(key_imp key) const
std::string range_error_message([[maybe_unused]] key_imp key) const
{
std::stringstream ss;
if constexpr (std::is_convertible<key_imp, std::string>::value) {
......
......@@ -129,10 +129,8 @@ std::string whitespaceify(const T& t, const char whitespace = ' ')
{
const std::string s = to_string(t);
std::string ret = "";
for (auto ii : value_range(s.size())) {
for ([[maybe_unused]] auto ii : value_range(s.size()))
ret += whitespace;
(void)ii;
}
return ret;
} // ... whitespaceify(...)
......
......@@ -417,10 +417,11 @@ private:
template <class FullType, class SingleType>
void single_derivative_helper_call(const std::vector<FullType>& val,
const size_t row,
const size_t col,
[[maybe_unused]] const size_t col,
std::vector<SingleType>& ret) const
{
if constexpr (rC == 1) {
assert(col == 0);
for (size_t ii = 0; ii < val.size(); ++ii)
ret[ii] = val[ii][row];
} else {
......@@ -705,9 +706,10 @@ public:
private:
template <class FullType>
static SingleDerivativeRangeType
single_derivative_helper_call(const FullType& val, const size_t row, const size_t col)
single_derivative_helper_call(const FullType& val, const size_t row, [[maybe_unused]] const size_t col)
{
if constexpr (rC == 1) {
assert(col == 0);
return val[row];
} else {
SingleDerivativeRangeType ret;
......
......@@ -83,10 +83,8 @@ size_t max_number_of_neighbors(const GridLayerType& grid_layer)
size_t maxNeighbours = 0;
for (auto&& entity : elements(grid_layer)) {
size_t neighbours = 0;
for (auto&& intersection : intersections(grid_layer, entity)) {
(void)intersection; // silence unused variable warning
for ([[maybe_unused]] auto&& intersection : intersections(grid_layer, entity))
++neighbours;
}
maxNeighbours = std::max(maxNeighbours, neighbours);
}
return maxNeighbours;
......
......@@ -45,9 +45,8 @@ GTEST_TEST(ProfilerTest, Timing)
GTEST_TEST(ProfilerTest, ScopedTiming)
{
const auto dvalue_range = value_range(1, 4);
for ([[maybe_unused] auto i : dvalue_range) {
for ([[maybe_unused]] auto i : dvalue_range)
scoped_busywait("ProfilerTest.ScopedTiming", wait_ms);
}
EXPECT_GE(DXTC_TIMINGS.walltime("ProfilerTest.ScopedTiming"), long(dvalue_range.size() * wait_ms));
}
......
......@@ -80,8 +80,7 @@ struct PeriodicViewTest : public testing::Test
const PeriodicGridViewType periodic_grid_view(grid_view, periodic_directions);
// check interface
const GridType& test_grid = periodic_grid_view.grid();
(void)test_grid;
[[maybe_unused]] const GridType& test_grid = periodic_grid_view.grid();
const IndexSet& index_set = periodic_grid_view.indexSet();
const int codim0_size = periodic_grid_view.size(0);
EXPECT_EQ(grid_view.size(0), codim0_size);
......@@ -95,8 +94,7 @@ struct PeriodicViewTest : public testing::Test
EXPECT_EQ(grid_view.overlapSize(1), periodic_grid_view.overlapSize(1));
EXPECT_EQ(grid_view.ghostSize(0), periodic_grid_view.ghostSize(0));
EXPECT_EQ(grid_view.ghostSize(1), periodic_grid_view.ghostSize(1));
const CollectiveCommunication& test_comm = periodic_grid_view.comm();
(void)test_comm;
[[maybe_unused]] const CollectiveCommunication& test_comm = periodic_grid_view.comm();
size_t neighbor_count = 0;
......@@ -106,8 +104,7 @@ struct PeriodicViewTest : public testing::Test
for (auto&& element : elements(periodic_grid_view)) {
EXPECT_TRUE(periodic_grid_view.contains(element));
EXPECT_TRUE(index_set.contains(element));
const auto sub_index = index_set.subIndex(element, 0, 1);
(void)sub_index;
[[maybe_unused]] const auto sub_index = index_set.subIndex(element, 0, 1);
// iterate over all intersections on current element
for (auto&& intersection : intersections(periodic_grid_view, element)) {
if (intersection.neighbor()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment