From b433183e0e3f1cd8b8ca1887aab454a066a761e8 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Fri, 5 Nov 2021 21:52:43 +0100 Subject: [PATCH] cpu/kinetis: silence -Wcast-align --- cpu/kinetis/periph/flashpage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cpu/kinetis/periph/flashpage.c b/cpu/kinetis/periph/flashpage.c index cd3d0e0680..3b92e859f3 100644 --- a/cpu/kinetis/periph/flashpage.c +++ b/cpu/kinetis/periph/flashpage.c @@ -88,8 +88,11 @@ enum { ERASE_ERROR = -6, }; -/* Pointer to FCCOB register */ -volatile uint32_t *const FCCOBx = (volatile uint32_t *)&FTFx->FCCOB3; +/* Pointer to FCCOB register. An intermediate cast is used to silence + * -Wcast-align as the address of the h/w register is properly aligned + * for 32 bit accesses + */ +static volatile uint32_t *const FCCOBx = (volatile uint32_t *)(uintptr_t)&FTFx->FCCOB3; /* Erasing/Programming flash is not allowed inside the same flash block where the program is being read, for _run_command to be executed in