From 9deed9edbf2d75961155c77b4c0e1b545b7d236b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 10 May 2013 11:58:39 +0200 Subject: [PATCH] libtests/malloc04: Prevent compiler optimizations --- testsuites/libtests/malloc04/init.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/testsuites/libtests/malloc04/init.c b/testsuites/libtests/malloc04/init.c index 89cbab327f..c1fc2367e1 100644 --- a/testsuites/libtests/malloc04/init.c +++ b/testsuites/libtests/malloc04/init.c @@ -41,7 +41,12 @@ void *rtems_heap_null_extend( #endif char Malloc_Heap[ 256 ] CPU_STRUCTURE_ALIGNMENT; -int sbrk_count; + +/* + * Use volatile to prevent compiler optimizations due to the malloc() builtin. + */ +volatile int sbrk_count; + Heap_Control TempHeap; size_t offset;