File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
connectivity/drivers/emac/TARGET_STM
hal/tests/TESTS/mbed_hal/mpu Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 1818#if DEVICE_EMAC
1919
2020#include < stdlib.h>
21+ #include < algorithm>
2122
2223#include " cmsis_os.h"
2324
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ void mpu_fault_test_bss()
134134
135135void mpu_fault_test_stack ()
136136{
137- uint16_t stack_function;
137+ volatile uint16_t stack_function;
138138
139139 stack_function = ASM_BX_LR;
140140 clear_caches ();
@@ -143,14 +143,14 @@ void mpu_fault_test_stack()
143143
144144void mpu_fault_test_heap ()
145145{
146- uint16_t *heap_function = (uint16_t *)malloc (2 );
146+ uint16_t volatile *heap_function = (uint16_t *)malloc (2 );
147147
148148 TEST_ASSERT_NOT_EQUAL (NULL , heap_function);
149149 *heap_function = ASM_BX_LR;
150150 clear_caches ();
151151 mpu_fault_test (heap_function);
152152
153- free (heap_function);
153+ free (const_cast < uint16_t *>( heap_function) );
154154}
155155
156156utest::v1::status_t fault_override_setup (const Case *const source, const size_t index_of_case)
You can’t perform that action at this time.
0 commit comments