diff options
| author | Damien George <damien@micropython.org> | 2021-06-10 22:48:54 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-06-10 22:48:54 +1000 |
| commit | 61f91de361c2c44e43fe326ea961b3cf68fcc310 (patch) | |
| tree | 85ac1ff895e5ce4d353650b55f6555354c23008b | |
| parent | cf849d84b984081b1b745edbad2dccd06bdb339f (diff) | |
stm32/sdram: Prevent array-bounds warnings with GCC 11.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | ports/stm32/sdram.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ports/stm32/sdram.c b/ports/stm32/sdram.c index 2791df277..514192519 100644 --- a/ports/stm32/sdram.c +++ b/ports/stm32/sdram.c @@ -276,6 +276,13 @@ void sdram_leave_low_power(void) { (0 << 9U)); // Mode Register Definition } +#if __GNUC__ >= 11 +// Prevent array bounds warnings when accessing SDRAM_START_ADDRESS as a memory pointer. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + bool sdram_test(bool fast) { uint8_t const pattern = 0xaa; uint8_t const antipattern = 0x55; @@ -325,4 +332,8 @@ bool sdram_test(bool fast) { return true; } +#if __GNUC__ >= 11 +#pragma GCC diagnostic pop +#endif + #endif // FMC_SDRAM_BANK |
