mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 04:00:28 +01:00
stm32/sdram: Prevent array-bounds warnings with GCC 11.
Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user