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>
This commit is contained in:
Damien George 2021-05-27 23:57:51 +10:00
parent 62f75376dd
commit 211c3e41f1
1 changed files with 8 additions and 0 deletions

View File

@ -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;
}