]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Alternative way to avoid warnings. 13091/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 16 Dec 2021 14:46:14 +0000 (07:46 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 16 Dec 2021 14:46:14 +0000 (07:46 -0700)
include/deal.II/matrix_free/fe_evaluation.h

index ca1be236f11c5d08e8779a7f195934ebb7555325..8d8ee87007077c26f07aab582306051b33fe9722 100644 (file)
@@ -3666,7 +3666,10 @@ FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
       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<const unsigned int *, n_lanes> 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<dim, n_components_, Number, is_face, VectorizedArrayType>::
           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<dim, n_components_, Number, is_face, VectorizedArrayType>::
           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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.