]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix warning about possibly uninitialized variables 14077/head
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Wed, 29 Jun 2022 14:45:55 +0000 (16:45 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Wed, 29 Jun 2022 14:45:55 +0000 (16:45 +0200)
include/deal.II/grid/tria_accessor.templates.h

index 63c46968bf8bf6468b94e23b212a48c0b5e50f4a..992f1b1ded0c783555d43fc6fafcd59b45d228cc 100644 (file)
@@ -1069,7 +1069,7 @@ namespace internal
       {
         // For 2D cells the access cell->line_orientation() is already
         // efficient
-        std::array<unsigned int, 4> line_indices;
+        std::array<unsigned int, 4> line_indices = {};
         for (unsigned int line : cell.line_indices())
           line_indices[line] = cell.line_index(line);
         return line_indices;
@@ -1084,7 +1084,7 @@ namespace internal
       get_line_indices_of_cell(
         const TriaAccessor<structdim, dim, spacedim> &cell)
       {
-        std::array<unsigned int, 12> line_indices;
+        std::array<unsigned int, 12> line_indices = {};
 
         // For hexahedra, the classical access via quads -> lines is too
         // inefficient. Unroll this code here to allow the compiler to inline
@@ -1164,7 +1164,7 @@ namespace internal
       {
         // For 2D cells the access cell->line_orientation() is already
         // efficient
-        std::array<bool, 4> line_orientations;
+        std::array<bool, 4> line_orientations = {};
         for (unsigned int line : cell.line_indices())
           line_orientations[line] = cell.line_orientation(line);
         return line_orientations;
@@ -1180,7 +1180,7 @@ namespace internal
       static std::array<bool, 12>
       get_line_orientations_of_cell(const TriaAccessor<3, dim, spacedim> &cell)
       {
-        std::array<bool, 12> line_orientations;
+        std::array<bool, 12> line_orientations = {};
 
         // For hexahedra, the classical access via quads -> lines is too
         // inefficient. Unroll this code here to allow the compiler to inline

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.