mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/cortexm_common: Silence -Wcast-align false positives
Verified that each warning generated by -Wcast-align is indeed a false positive and used an (intermediate) cast to `uintptr_t` to silence the warnings.
This commit is contained in:
parent
4243c180cb
commit
0e097b54a4
@ -238,7 +238,10 @@ char *thread_stack_init(thread_task_func_t task_func,
|
|||||||
void thread_stack_print(void)
|
void thread_stack_print(void)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
uint32_t *sp = (uint32_t *)thread_get_active()->sp;
|
/* The stack pointer will be aligned to word boundary by thread_create,
|
||||||
|
* which is 32 bit for all Cortex M MCUs. We can silence -Wcast-align here
|
||||||
|
*/
|
||||||
|
uint32_t *sp = (uint32_t *)(uintptr_t)thread_get_active()->sp;
|
||||||
|
|
||||||
printf("printing the current stack of thread %" PRIkernel_pid "\n",
|
printf("printing the current stack of thread %" PRIkernel_pid "\n",
|
||||||
thread_getpid());
|
thread_getpid());
|
||||||
|
Loading…
Reference in New Issue
Block a user