From 6ac2087368161774e7c03f76aaf5436874e19f10 Mon Sep 17 00:00:00 2001 From: Eric Vantillard Date: Wed, 14 Sep 2022 13:56:45 +0200 Subject: [PATCH] Fix 'maybe-uninitialized' g++ error on macos (#600) --- test/test_fixed_iterator.cpp | 16 ++++++++-------- test/test_hash.cpp | 6 +++--- test/test_multi_array.cpp | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/test_fixed_iterator.cpp b/test/test_fixed_iterator.cpp index 3c6925c1..d8cde672 100644 --- a/test/test_fixed_iterator.cpp +++ b/test/test_fixed_iterator.cpp @@ -55,7 +55,7 @@ namespace //************************************************************************* TEST(test_copy_constructor) { - int a; + int a{}; etl::fixed_iterator fi1(&a); etl::fixed_iterator fi2(fi1); @@ -66,7 +66,7 @@ namespace //************************************************************************* TEST(test_constructor) { - int a; + int a{}; etl::fixed_iterator fi(&a); @@ -76,7 +76,7 @@ namespace //************************************************************************* TEST(test_make) { - int a; + int a{}; etl::fixed_iterator fi = &a; @@ -121,7 +121,7 @@ namespace //************************************************************************* TEST(test_conversion_operator) { - int a; + int a{}; etl::fixed_iterator fi(&a); @@ -202,8 +202,8 @@ namespace //************************************************************************* TEST(test_assignment) { - int a; - int b; + int a{}; + int b{}; etl::fixed_iterator fi = &a; fi = &b; @@ -218,8 +218,8 @@ namespace //************************************************************************* TEST(test_equality) { - int a; - int b; + int a{}; + int b{}; etl::fixed_iterator fi1 = &a; etl::fixed_iterator fi2 = &a; diff --git a/test/test_hash.cpp b/test/test_hash.cpp index 19c1fc47..8a1bd8a4 100644 --- a/test/test_hash.cpp +++ b/test/test_hash.cpp @@ -202,7 +202,7 @@ namespace //************************************************************************* TEST(test_hash_pointer) { - int i; + int i{}; size_t hash = etl::hash()(&i); CHECK_EQUAL(size_t(&i), hash); @@ -211,7 +211,7 @@ namespace //************************************************************************* TEST(test_hash_const_pointer) { - int i; + int i{}; size_t hash = etl::hash()(&i); CHECK_EQUAL(size_t(&i), hash); @@ -220,7 +220,7 @@ namespace //************************************************************************* TEST(test_hash_const_pointer_const) { - int i; + int i{}; const int * const pi = &i; size_t hash = etl::hash()(pi); diff --git a/test/test_multi_array.cpp b/test/test_multi_array.cpp index 5d0af28a..78ba585c 100644 --- a/test/test_multi_array.cpp +++ b/test/test_multi_array.cpp @@ -298,7 +298,7 @@ namespace //************************************************************************* TEST(test_empty) { - Data data; + Data data{}; CHECK(!data.empty()); CHECK(!data[0].empty());