From: Wolfgang Bangerth Date: Thu, 16 Dec 2021 14:46:14 +0000 (-0700) Subject: Alternative way to avoid warnings. X-Git-Tag: v9.4.0-rc1~726^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13091%2Fhead;p=dealii.git Alternative way to avoid warnings. --- diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index ca1be236f1..8d8ee87007 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -3666,7 +3666,10 @@ FEEvaluationBase:: return; } - const unsigned int *dof_indices[n_lanes]; + // Allocate pointers, then initialize all of them to nullptrs and + // below overwrite the ones we actually use: + std::array dof_indices; + dof_indices.fill(nullptr); // Assign the appropriate cell ids for face/cell case and get the pointers // to the dof indices of the cells on all lanes @@ -3706,8 +3709,6 @@ FEEvaluationBase:: dof_indices[v] = this->dof_info->dof_indices.data() + my_index_start[0].first; } - for (unsigned int v = n_vectorization_actual; v < n_lanes; ++v) - dof_indices[v] = nullptr; } else { @@ -3740,8 +3741,6 @@ FEEvaluationBase:: dof_indices[v] = this->dof_info->dof_indices.data() + my_index_start[0].first; } - for (unsigned int v = n_vectorization_actual; v < n_lanes; ++v) - dof_indices[v] = nullptr; } // Case where we have no constraints throughout the whole cell: Can go