avoid gcc warnings (and potential errors) when strict aliasing is on

This commit is contained in:
Markus Fröschle
2013-07-22 08:09:49 +00:00
parent ebc8f90743
commit a8744a81e8
2 changed files with 5 additions and 1 deletions

View File

@@ -24,7 +24,9 @@
*********************************************************************/
/* Register read/write macros */
#define MCF_MMU_MMUCR (*(volatile uint32_t*)(&_MMUBAR[0]))
/* note the uint32_t_a - this is to avoid gcc warnings about pointer aliasing */
#define MCF_MMU_MMUCR (*(volatile uint32_t_a*)(&_MMUBAR[0]))
#define MCF_MMU_MMUOR (*(volatile uint32_t*)(&_MMUBAR[0x4]))
#define MCF_MMU_MMUSR (*(volatile uint32_t*)(&_MMUBAR[0x8]))
#define MCF_MMU_MMUAR (*(volatile uint32_t*)(&_MMUBAR[0x10]))