]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix an array initialization. 8071/head
authorDavid Wells <drwells@email.unc.edu>
Fri, 10 May 2019 15:27:10 +0000 (11:27 -0400)
committerDavid Wells <drwells@email.unc.edu>
Fri, 10 May 2019 15:27:10 +0000 (11:27 -0400)
GCC 4.8 complains about the brace initialization:

./source/grid/manifold_lib.cc:1804:75:
warning: missing initializer for member 'std::array<double, 12ul>::_M_elems'
[-Wmissing-field-initializers]
         std::array<double, GeometryInfo<3>::lines_per_cell> weights_lines{};
                                                                           ^

so be safe and initalize explicitly with fill.

source/grid/manifold_lib.cc

index eb0be274ff17419fccf391a3153ff102863458bc..0008707c0b8984e636986a6a8a96917932b1c039 100644 (file)
@@ -1801,7 +1801,8 @@ namespace
         // identify the weights for the lines to be accumulated (vertex
         // weights are set outside and coincide with the flat manifold case)
 
-        std::array<double, GeometryInfo<3>::lines_per_cell> weights_lines{};
+        std::array<double, GeometryInfo<3>::lines_per_cell> weights_lines;
+        std::fill(weights_lines.begin(), weights_lines.end(), 0.0);
 
         // start with the contributions of the faces
         std::array<double, GeometryInfo<2>::vertices_per_cell>          weights;

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.