1
0
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:
Marian Buschsieweke 2020-09-22 14:37:55 +02:00
parent 4243c180cb
commit 0e097b54a4
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -238,7 +238,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());