mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
cxx: suppress -Warray-bounds warning for a test
This commit is contained in:
parent
9386014201
commit
b415476904
@ -20,7 +20,11 @@ extern "C" void tearDown()
|
|||||||
TEST_CASE("std::out_of_range exception when -fno-exceptions", "[cxx][reset=abort,SW_CPU_RESET]")
|
TEST_CASE("std::out_of_range exception when -fno-exceptions", "[cxx][reset=abort,SW_CPU_RESET]")
|
||||||
{
|
{
|
||||||
std::vector<int> v(10);
|
std::vector<int> v(10);
|
||||||
|
// suppress warning because of this test
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||||
v.at(20) = 42;
|
v.at(20) = 42;
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
TEST_FAIL_MESSAGE("Unreachable because we are aborted on the line above");
|
TEST_FAIL_MESSAGE("Unreachable because we are aborted on the line above");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user