From f622be3c25daa0bdb3db4746203a8f3eac64ddd6 Mon Sep 17 00:00:00 2001 From: Yingli Li <142116485+liyli26@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:53:53 -0600 Subject: [PATCH] fix_void_problem --- source/base/function_lib.cc | 2 +- source/base/mpi.cc | 4 ++-- source/grid/tria.cc | 26 +++++++++++++------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/source/base/function_lib.cc b/source/base/function_lib.cc index 2e9138080a..2e2ec9e1ee 100644 --- a/source/base/function_lib.cc +++ b/source/base/function_lib.cc @@ -2405,7 +2405,7 @@ namespace Functions const Point<1> &p_unit, const Point<1> &dx) { - (void)p_unit; + [[mabe_unused]]p_unit; Tensor<1, 1> grad; grad[0] = (data_values[ix[0] + 1] - data_values[ix[0]]) / dx[0]; return grad; diff --git a/source/base/mpi.cc b/source/base/mpi.cc index e99ba8386d..68e3dae9bf 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -794,7 +794,7 @@ namespace Utilities void CollectiveMutex::lock(const MPI_Comm comm) { - (void)comm; + [[mabe_unused]]comm; Assert( !locked, @@ -831,7 +831,7 @@ namespace Utilities void CollectiveMutex::unlock(const MPI_Comm comm) { - (void)comm; + [[mabe_unused]]comm; // First check if this function is called during exception handling // if so, abort. This can happen if a ScopedLock is destroyed. diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 3b42873808..210ddf0453 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -3519,7 +3519,7 @@ namespace internal if (subcell_object->boundary_id != numbers::internal_face_boundary_id) { - (void)vertex_locations; + [[mabe_unused]]vertex_locations; AssertThrow( boundary_id != numbers::internal_face_boundary_id, ExcMessage( @@ -3549,7 +3549,7 @@ namespace internal // make sure that all subcelldata entries have been processed // TODO: this is not guaranteed, why? // AssertDimension(counter, boundary_objects_in.size()); - (void)counter; + [[mabe_unused]]counter; } @@ -5038,7 +5038,7 @@ namespace internal triangulation.vertices[next_unused_vertex] = line->center(true); bool pair_found = false; - (void)pair_found; + [[mabe_unused]]pair_found; for (; next_unused_line != endl; ++next_unused_line) if (!next_unused_line->used() && !(++next_unused_line)->used()) @@ -5808,7 +5808,7 @@ namespace internal // two child lines. To this end, find a pair of // unused lines bool pair_found = false; - (void)pair_found; + [[mabe_unused]]pair_found; for (; next_unused_line != endl; ++next_unused_line) if (!next_unused_line->used() && !(++next_unused_line)->used()) @@ -6232,7 +6232,7 @@ namespace internal for (const unsigned int line : quad->line_indices()) { AssertIsNotUsed(new_lines[line]); - (void)line; + [[mabe_unused]]line; } // 2) create new quads (properties are set below). Both triangles @@ -6254,7 +6254,7 @@ namespace internal for (const auto &quad : new_quads) { AssertIsNotUsed(quad); - (void)quad; + [[mabe_unused]]quad; } // 3) set vertex indices and set new vertex @@ -11934,10 +11934,10 @@ namespace internal std::vector &quad_cell_count) { AssertThrow(false, ExcNotImplemented()); - (void)triangulation; - (void)cell; - (void)line_cell_count; - (void)quad_cell_count; + [[mabe_unused]]triangulation; + [[mabe_unused]]cell; + [[mabe_unused]]line_cell_count; + [[mabe_unused]]quad_cell_count; } template @@ -11955,7 +11955,7 @@ namespace internal Triangulation &triangulation) { // nothing to do since anisotropy is not supported - (void)triangulation; + [[mabe_unused]]triangulation; } template @@ -12293,7 +12293,7 @@ void Triangulation::set_all_manifold_ids_on_boundary( } } - (void)boundary_found; + [[mabe_unused]]boundary_found; Assert(boundary_found, ExcBoundaryIdNotFound(b_id)); } @@ -16304,7 +16304,7 @@ void Triangulation::load_attached_data( // CellStatus::cell_will_persist. for (const auto &cell_rel : this->local_cell_relations) { - (void)cell_rel; + [[mabe_unused]]cell_rel; Assert((cell_rel.second == // cell_status ::dealii::CellStatus::cell_will_persist), ExcInternalError()); -- 2.39.5