Mark uninitialized use from std library

Similar to other cases, adds compiler pragmas against warnings
caused by std library in optimized builds of tests
This commit is contained in:
Roland Reichwein 2026-03-13 20:32:45 +01:00
parent a0c98662ca
commit 2b7eedf97a
5 changed files with 16 additions and 0 deletions

View File

@ -375,6 +375,7 @@ namespace etl
}
#include "private/diagnostic_pop.h"
#include "private/diagnostic_uninitialized_push.h"
//********************************************
template <typename TType>
bool add_new_message_type(etl::imessage&& msg)
@ -390,6 +391,7 @@ namespace etl
return false;
}
}
#include "private/diagnostic_pop.h"
typename etl::aligned_storage<SIZE, ALIGNMENT>::type data;
bool valid;

View File

@ -363,6 +363,7 @@ namespace etl
}
#include "private/diagnostic_pop.h"
#include "private/diagnostic_uninitialized_push.h"
//********************************************
template <typename TType>
bool add_new_message_type(etl::imessage&& msg)
@ -378,6 +379,7 @@ namespace etl
return false;
}
}
#include "private/diagnostic_pop.h"
typename etl::aligned_storage<SIZE, ALIGNMENT>::type data;
bool valid;

View File

@ -713,6 +713,7 @@ namespace etl
//***************************************************************************
/// get_token
//***************************************************************************
#include "private/diagnostic_uninitialized_push.h"
template <typename TInput, typename TStringView>
etl::optional<TStringView> get_token(const TInput& input, typename TInput::const_pointer delimiters, const etl::optional<TStringView>& last_view, bool ignore_empty_tokens)
{
@ -755,6 +756,7 @@ namespace etl
return etl::optional<TStringView>(view);
}
#include "private/diagnostic_pop.h"
//***************************************************************************
/// get_token_list

View File

@ -513,6 +513,7 @@ namespace
}
//*************************************************************************
#include "etl/private/diagnostic_uninitialized_push.h"
TEST_FIXTURE(SetupFixture, test_front)
{
Compare_Data compare_data(initial_data.begin(), initial_data.end());
@ -523,8 +524,10 @@ namespace
Data emptyData;
CHECK_THROW(emptyData.front(), etl::vector_out_of_bounds);
}
#include "etl/private/diagnostic_pop.h"
//*************************************************************************
#include "etl/private/diagnostic_uninitialized_push.h"
TEST_FIXTURE(SetupFixture, test_front_const)
{
const Compare_Data compare_data(initial_data.begin(), initial_data.end());
@ -535,6 +538,7 @@ namespace
const Data emptyData;
CHECK_THROW(emptyData.front(), etl::vector_out_of_bounds);
}
#include "etl/private/diagnostic_pop.h"
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_back)
@ -998,6 +1002,7 @@ namespace
}
//*************************************************************************
#include "etl/private/diagnostic_uninitialized_push.h"
TEST_FIXTURE(SetupFixture, test_insert_position_n_value_outofbounds)
{
const int INITIAL_VALUE = 0;
@ -1007,6 +1012,7 @@ namespace
CHECK_THROW(data.insert(data2.end(), 1, INITIAL_VALUE);, etl::vector_out_of_bounds);
}
#include "etl/private/diagnostic_pop.h"
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_insert_position_n_value_excess)
@ -1062,6 +1068,7 @@ namespace
}
//*************************************************************************
#include "etl/private/diagnostic_uninitialized_push.h"
TEST_FIXTURE(SetupFixture, test_insert_position_range_out_of_bounds)
{
Data data;
@ -1069,6 +1076,7 @@ namespace
CHECK_THROW(data.insert(data2.end(), insert_data.cbegin(), insert_data.cend());, etl::vector_out_of_bounds);
}
#include "etl/private/diagnostic_pop.h"
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_insert_position_range_excess)

View File

@ -1022,6 +1022,7 @@ namespace
}
//*************************************************************************
#include "etl/private/diagnostic_array_bounds_push.h"
TEST(test_emplace_out_of_range_before_begin)
{
DataNDC data;
@ -1032,6 +1033,7 @@ namespace
CHECK_THROW(data.emplace(it, INITIAL_VALUE), etl::vector_out_of_bounds);
}
#include "etl/private/diagnostic_pop.h"
//*************************************************************************
#include "etl/private/diagnostic_array_bounds_push.h"