Merge pull request #15099 from maribu/cortexm-common-cast-align

cpu/cortexm_common: Silence -Wcast-align false positives
This commit is contained in:
benpicco 2020-11-18 00:38:03 +01:00 committed by GitHub
commit 1f7fdbc97a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -239,7 +239,10 @@ char *thread_stack_init(thread_task_func_t task_func,
void thread_stack_print(void)
{
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",
thread_getpid());