From: David Wells Date: Mon, 16 Jan 2023 18:09:42 +0000 (-0500) Subject: Re-implement a compiler warning workaround X-Git-Tag: v9.5.0-rc1~641^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14687%2Fhead;p=dealii.git Re-implement a compiler warning workaround --- diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 78ca6cecbb..00740c5c45 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -5716,7 +5716,10 @@ namespace internal const std::array line_indices = TriaAccessorImplementation::Implementation:: get_line_indices_of_cell(*hex); - for (unsigned int l = 0; l < hex->n_lines(); ++l) + // avoid a compiler warning by fixing the max number of + // loop iterations to 12 + const unsigned int n_lines = std::min(hex->n_lines(), 12u); + for (unsigned int l = 0; l < n_lines; ++l) { raw_line_iterator line(&triangulation, 0,