I run a baremetal Xilinx-based ARM A57 system.
I want to bring the addresses of two linker-defined symbols to my c program...
This is the linker script:
.mutex_ram: {
_mutex_start = .;
. += _MUTEX_SIZE;
. = ALIGN(8);
_mutex_end = .;
} > mem_common
This is a brief summary of what I want to do in C.
extern int _mutex_start;
extern int _mutex_end;
void some_fcn(void)
{
int size = (int)(&_mutex_end)-(int)(&_mutex_start);
memset(&_mutex_start,0,size);
}
Why the heck does the compiler warn me that this is a different-size integer cast? I just don't get it...
warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
Can somebody help me?