regression 1010: fix Clang warning and prevent unwanted optimization
Fixes the following Clang warning:
os_test.c:906:3: warning: indirection of non-volatile null pointer will be deleted, not trap [-Wnull-dereference]
*((uint32_t *) 0) = 0;
^~~~~~~~~~~~~~~~~
os_test.c:906:3: note: consider using __builtin_trap() or qualifying pointer with 'volatile'
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/ta/os_test/os_test.c b/ta/os_test/os_test.c
index 52d7b49..29c6814 100644
--- a/ta/os_test/os_test.c
+++ b/ta/os_test/os_test.c
@@ -903,7 +903,7 @@
switch (params[0].value.a) {
case 1:
- *((uint32_t *) 0) = 0;
+ *((volatile uint32_t *)0) = 0;
break;
case 2:
*((uint32_t *)(stack_addr + 0x40000000)) = 0;