Commit a0aca3cb authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'float-1471-compilation-fix-for-wmc-tool-broke-stack-memory-calculation' into 'main'

[CI]Resolve "Compilation fix for WMC tool broke stack memory calculation"

See merge request !2443
parents fdcce24c cda355cf
Loading
Loading
Loading
Loading
Loading
+5 −19
Original line number Diff line number Diff line
@@ -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 */