diff --git a/demos/STM32/RT-STM32G071RB-NUCLEO64/Makefile b/demos/STM32/RT-STM32G071RB-NUCLEO64/Makefile index 4473a9239..ee6928c53 100644 --- a/demos/STM32/RT-STM32G071RB-NUCLEO64/Makefile +++ b/demos/STM32/RT-STM32G071RB-NUCLEO64/Makefile @@ -136,7 +136,7 @@ ASMXSRC = $(ALLXASMSRC) INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC) # Define C warning options here. -CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -Wcast-align=strict # Define C++ warning options here. CPPWARN = -Wall -Wextra -Wundef diff --git a/demos/STM32/RT-STM32L552ZE-NUCLEO144-TZ_GUEST/Makefile b/demos/STM32/RT-STM32L552ZE-NUCLEO144-TZ_GUEST/Makefile index 965443fb8..eb56db88c 100644 --- a/demos/STM32/RT-STM32L552ZE-NUCLEO144-TZ_GUEST/Makefile +++ b/demos/STM32/RT-STM32L552ZE-NUCLEO144-TZ_GUEST/Makefile @@ -136,7 +136,7 @@ ASMXSRC = $(ALLXASMSRC) INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC) # Define C warning options here. -CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -Wcast-align=strict # Define C++ warning options here. CPPWARN = -Wall -Wextra -Wundef diff --git a/demos/STM32/RT-STM32L552ZE-NUCLEO144-TZ_HOST/Makefile b/demos/STM32/RT-STM32L552ZE-NUCLEO144-TZ_HOST/Makefile index 7d1c71823..24843ce2a 100644 --- a/demos/STM32/RT-STM32L552ZE-NUCLEO144-TZ_HOST/Makefile +++ b/demos/STM32/RT-STM32L552ZE-NUCLEO144-TZ_HOST/Makefile @@ -137,7 +137,7 @@ ASMXSRC = $(ALLXASMSRC) INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC) # Define C warning options here. -CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -Wcast-align=strict # Define C++ warning options here. CPPWARN = -Wall -Wextra -Wundef diff --git a/demos/STM32/RT-STM32L552ZE-NUCLEO144/Makefile b/demos/STM32/RT-STM32L552ZE-NUCLEO144/Makefile index fa38622e3..acde1d6ca 100644 --- a/demos/STM32/RT-STM32L552ZE-NUCLEO144/Makefile +++ b/demos/STM32/RT-STM32L552ZE-NUCLEO144/Makefile @@ -136,7 +136,7 @@ ASMXSRC = $(ALLXASMSRC) INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC) # Define C warning options here. -CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -Wcast-align=strict # Define C++ warning options here. CPPWARN = -Wall -Wextra -Wundef diff --git a/os/common/ports/ARMv6-M/chcore.h b/os/common/ports/ARMv6-M/chcore.h index 18fc79ea4..4541e92c9 100644 --- a/os/common/ports/ARMv6-M/chcore.h +++ b/os/common/ports/ARMv6-M/chcore.h @@ -329,8 +329,8 @@ struct port_context { * by an @p port_intctx structure. */ #define PORT_SETUP_CONTEXT(tp, wbase, wtop, pf, arg) do { \ - (tp)->ctx.sp = (struct port_intctx *)((uint8_t *)(wtop) - \ - sizeof (struct port_intctx)); \ + (tp)->ctx.sp = (struct port_intctx *)(void *) \ + ((uint8_t *)(wtop) - sizeof (struct port_intctx)); \ (tp)->ctx.sp->r4 = (uint32_t)(pf); \ (tp)->ctx.sp->r5 = (uint32_t)(arg); \ (tp)->ctx.sp->lr = (uint32_t)__port_thread_start; \ diff --git a/os/common/ports/ARMv8-M-ML-TZ/chcore.h b/os/common/ports/ARMv8-M-ML-TZ/chcore.h index 723159a77..33d0a3bca 100644 --- a/os/common/ports/ARMv8-M-ML-TZ/chcore.h +++ b/os/common/ports/ARMv8-M-ML-TZ/chcore.h @@ -534,8 +534,8 @@ struct port_context { */ #define PORT_SETUP_CONTEXT(tp, wbase, wtop, pf, arg) do { \ PORT_SETUP_CONTEXT_BASEPRI_NS(tp); \ - (tp)->ctx.sp = (struct port_intctx *)((uint8_t *)(wtop) - \ - sizeof (struct port_intctx)); \ + (tp)->ctx.sp = (struct port_intctx *)(void *) \ + ((uint8_t *)(wtop) - sizeof (struct port_intctx)); \ (tp)->ctx.basepri = CORTEX_BASEPRI_KERNEL; \ (tp)->ctx.r5 = (uint32_t)(arg); \ (tp)->ctx.r4 = (uint32_t)(pf); \ diff --git a/os/common/ports/ARMv8-M-ML/chcore.h b/os/common/ports/ARMv8-M-ML/chcore.h index 4adc61fc7..547faf38d 100644 --- a/os/common/ports/ARMv8-M-ML/chcore.h +++ b/os/common/ports/ARMv8-M-ML/chcore.h @@ -427,8 +427,8 @@ struct port_context { * by an @p port_intctx structure. */ #define PORT_SETUP_CONTEXT(tp, wbase, wtop, pf, arg) do { \ - (tp)->ctx.sp = (struct port_intctx *)((uint8_t *)(wtop) - \ - sizeof (struct port_intctx)); \ + (tp)->ctx.sp = (struct port_intctx *)(void *) \ + ((uint8_t *)(wtop) - sizeof (struct port_intctx)); \ (tp)->ctx.sp->r4 = (uint32_t)(pf); \ (tp)->ctx.sp->r5 = (uint32_t)(arg); \ (tp)->ctx.sp->lr = (uint32_t)__port_thread_start; \ diff --git a/os/rt/src/chdynamic.c b/os/rt/src/chdynamic.c index 391403f31..075666b7b 100644 --- a/os/rt/src/chdynamic.c +++ b/os/rt/src/chdynamic.c @@ -94,8 +94,8 @@ thread_t *chThdCreateFromHeap(memory_heap_t *heapp, size_t size, thread_descriptor_t td = THD_DESCRIPTOR(name, wbase, wend, prio, pf, arg); #if CH_DBG_FILL_THREADS == TRUE - __thd_memfill((uint8_t *)wsp, - (uint8_t *)wsp + size, + __thd_memfill((uint8_t *)wbase, + (uint8_t *)wbase + size, CH_DBG_STACK_FILL_VALUE); #endif @@ -152,8 +152,8 @@ thread_t *chThdCreateFromMemoryPool(memory_pool_t *mp, const char *name, thread_descriptor_t td = THD_DESCRIPTOR(name, wbase, wend, prio, pf, arg); #if CH_DBG_FILL_THREADS == TRUE - __thd_memfill((uint8_t *)wsp, - (uint8_t *)wsp + mp->object_size, + __thd_memfill((uint8_t *)wbase, + (uint8_t *)wbase + mp->object_size, CH_DBG_STACK_FILL_VALUE); #endif diff --git a/test/rt/testbuild/Makefile b/test/rt/testbuild/Makefile index ccc29d839..bca7bf27e 100755 --- a/test/rt/testbuild/Makefile +++ b/test/rt/testbuild/Makefile @@ -153,10 +153,10 @@ BIN = $(CP) -O binary COV = gcov # Define C warning options here -CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -Wcast-align=strict # Define C++ warning options here -CPPWARN = -Wall -Wextra -Wundef -Wcast-align=strict +CPPWARN = -Wall -Wextra -Wundef # # Compiler settings diff --git a/test/rt/testbuild/Makefile_win32 b/test/rt/testbuild/Makefile_win32 index dacf86670..b26064e3e 100755 --- a/test/rt/testbuild/Makefile_win32 +++ b/test/rt/testbuild/Makefile_win32 @@ -153,10 +153,10 @@ BIN = $(CP) -O binary COV = gcov # Define C warning options here -CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -Wcast-align=strict # Define C++ warning options here -CPPWARN = -Wall -Wextra -Wundef -Wcast-align=strict +CPPWARN = -Wall -Wextra -Wundef # # Compiler settings