diff options
| author | Damien George <damien@micropython.org> | 2021-05-27 23:57:51 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-05-27 23:57:51 +1000 |
| commit | 211c3e41f12295f08a883ac326386ecb5bc8d68e (patch) | |
| tree | d77fac0f33e60815b8021699e50b923346ccc5c8 | |
| parent | 62f75376dd6932a694569e2b7a8701b3a6b13a77 (diff) | |
stm32/boards/PYBD_SF2: Disable GCC 11 warnings for array bounds.
With GCC 11 there is now a warning about array bounds of OTP-mac, due to
the OTP being a literal address.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | ports/stm32/boards/PYBD_SF2/board_init.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ports/stm32/boards/PYBD_SF2/board_init.c b/ports/stm32/boards/PYBD_SF2/board_init.c index d1a0a09e7..c3b54fa2f 100644 --- a/ports/stm32/boards/PYBD_SF2/board_init.c +++ b/ports/stm32/boards/PYBD_SF2/board_init.c @@ -64,7 +64,15 @@ void board_sleep(int value) { void mp_hal_get_mac(int idx, uint8_t buf[6]) { // Check if OTP region has a valid MAC address, and use it if it does if (OTP->series == 0x00d1 && OTP->mac[0] == 'H' && OTP->mac[1] == 'J' && OTP->mac[2] == '0') { + #if __GNUC__ >= 11 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Warray-bounds" + #pragma GCC diagnostic ignored "-Wstringop-overread" + #endif memcpy(buf, OTP->mac, 6); + #if __GNUC__ >= 11 + #pragma GCC diagnostic pop + #endif buf[5] += idx; return; } |
