diff --git a/src/core/electrostatics_magnetostatics/fft.cpp b/src/core/electrostatics_magnetostatics/fft.cpp
index 22331ac93..f9f65418d 100644
--- a/src/core/electrostatics_magnetostatics/fft.cpp
+++ b/src/core/electrostatics_magnetostatics/fft.cpp
@@ -479,6 +479,9 @@ int map_3don2d_grid(int const g3d[3], int g2d[3], int mult[3]) {
/** calculate most square 2d grid. */
void calc_2d_grid(int n, int grid[3]) {
+ grid[0] = n;
+ grid[1] = 1;
+ grid[2] = 1;
for (auto i = static_cast<int>(std::sqrt(n)); i >= 1; i--) {
if (n % i == 0) {
grid[0] = n / i;
diff --git a/src/core/random.hpp b/src/core/random.hpp
index f8c6efb5f..8061b629d 100644
--- a/src/core/random.hpp
+++ b/src/core/random.hpp
@@ -77,7 +77,7 @@ Utils::Vector3d v_noise(uint64_t counter, int key1, int key2 = 0) {
auto const id1 = static_cast<uint32_t>(key1);
auto const id2 = static_cast<uint32_t>(key2);
- const key_type k{id1, id2};
+ const key_type k{{id1, id2}};
auto const noise = rng_type{}(c, k);
diff --git a/src/core/unit_tests/LocalBox_test.cpp b/src/core/unit_tests/LocalBox_test.cpp
index 26d899220..c456cee03 100644
--- a/src/core/unit_tests/LocalBox_test.cpp
+++ b/src/core/unit_tests/LocalBox_test.cpp
@@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE(constructors) {
{
Utils::Vector<double, 3> const lower_corner = {1., 2., 3.};
Utils::Vector<double, 3> const local_box_length = {4., 5., 6.};
- Utils::Array<int, 6> const boundaries = {-1, 0, 1, 1, 0, -1};
+ Utils::Array<int, 6> const boundaries = {{{-1, 0, 1, 1, 0, -1}}};
auto const box =
LocalBox<double>(lower_corner, local_box_length, boundaries);
diff --git a/src/utils/include/utils/interpolation/bspline_3d.hpp b/src/utils/include/utils/interpolation/bspline_3d.hpp
index b130f8fc6..9fb9f85d2 100644
--- a/src/utils/include/utils/interpolation/bspline_3d.hpp
+++ b/src/utils/include/utils/interpolation/bspline_3d.hpp
@@ -47,8 +47,8 @@ void bspline_3d(const Vector3d &pos, const Kernel &kernel,
const auto block = detail::ll_and_dist<order>(pos, grid_spacing, offset);
/* Precalc weights that are used multiple times. */
- std::array<double, order> w_y;
- std::array<double, order> w_z;
+ std::array<double, order> w_y{};
+ std::array<double, order> w_z{};
for (int i = 0; i < order; i++) {
w_y[i] = bspline<order>(i, block.distance[1]);
w_z[i] = bspline<order>(i, block.distance[2]);
diff --git a/src/utils/tests/Array_test.cpp b/src/utils/tests/Array_test.cpp
index cab5a7fb2..f55759118 100644
--- a/src/utils/tests/Array_test.cpp
+++ b/src/utils/tests/Array_test.cpp
@@ -48,7 +48,7 @@ BOOST_AUTO_TEST_CASE(array_ctor) {
}
BOOST_AUTO_TEST_CASE(iterators) {
- auto a = Array<int, 4>{{1, 2, 3, 4}};
+ auto a = Array<int, 4>{{{1, 2, 3, 4}}};
BOOST_CHECK(*(a.begin()) == 1);
BOOST_CHECK(*(a.cbegin()) == 1);
@@ -57,7 +57,7 @@ BOOST_AUTO_TEST_CASE(iterators) {
}
BOOST_AUTO_TEST_CASE(element_access) {
- auto a = Array<int, 5>{{5, 6, 7, 8, 9}};
+ auto a = Array<int, 5>{{{5, 6, 7, 8, 9}}};
int c = 5;
for (int i : a) {
diff --git a/src/utils/tests/tuple_test.cpp b/src/utils/tests/tuple_test.cpp
index 3954ebffd..870a091cf 100644
--- a/src/utils/tests/tuple_test.cpp
+++ b/src/utils/tests/tuple_test.cpp
@@ -28,12 +28,14 @@
#include "utils/tuple.hpp"
+#include <array>
+
BOOST_AUTO_TEST_CASE(for_each) {
using Utils::for_each;
/* l-value reference tuple */
{
- auto a = std::array<int, 3>{2, 3, 5};
+ auto a = std::array<int, 3>{{2, 3, 5}};
for_each(
[i = 0, a](int &e) mutable {
@@ -71,7 +73,7 @@ BOOST_AUTO_TEST_CASE(apply) {
using Utils::apply;
/* constexpr */
- { static_assert(apply(std::plus<>(), std::array<int, 2>{3, 8}) == 11, ""); }
+ { static_assert(apply(std::plus<>(), std::array<int, 2>{{3, 8}}) == 11, ""); }
/* l-value reference */
{