diff --git a/lib_debug/wmc_auto.c b/lib_debug/wmc_auto.c index 60c8df3006c48893d7570237f02a6111a3eadf74..30e7733f93523460838058541cadea64972e87c5 100644 --- a/lib_debug/wmc_auto.c +++ b/lib_debug/wmc_auto.c @@ -818,6 +818,7 @@ static void *mem_alloc_block( size_t size, const char *size_str ); void reset_mem( Counting_Size cnt_size ) { + int16_t something; size_t tmp_size; /* initialize list of stack records */ @@ -837,13 +838,7 @@ void reset_mem( Counting_Size cnt_size ) max_num_calls = MAX_NUM_RECORDS; /* initialize stack pointers */ -#if defined( __GNUC__ ) || defined( __clang__ ) - /* GCC/Clang: use builtin (works for many targets) */ - ptr_base_stack = __builtin_frame_address( 0 ); -#else - int16_t something; ptr_base_stack = &something; -#endif ptr_max_stack = ptr_base_stack; ptr_current_stack = ptr_base_stack; @@ -948,14 +943,10 @@ void reset_mem( Counting_Size cnt_size ) void reset_stack( void ) { - /* initialize/reset stack pointers */ -#if defined( __GNUC__ ) || defined( __clang__ ) - /* GCC/Clang: use builtin (works for many targets) */ - ptr_base_stack = __builtin_frame_address( 0 ); -#else int16_t something; + + /* initialize/reset stack pointers */ ptr_base_stack = &something; -#endif ptr_max_stack = ptr_base_stack; ptr_current_stack = ptr_base_stack; @@ -970,15 +961,10 @@ void reset_stack( void ) int push_stack( const char *filename, const char *fctname ) { + int16_t something; int32_t current_stack_size; -#if defined( __GNUC__ ) || defined( __clang__ ) - /* GCC/Clang: use builtin (works for many targets) */ - ptr_base_stack = __builtin_frame_address( 0 ); -#else - int16_t something; - ptr_base_stack = &something; -#endif + ptr_current_stack = &something; (void) *filename; /* to avoid compilation warning */