Skip to content

Commit

Permalink
Only ignore warnings if in gcc >= 11
Browse files Browse the repository at this point in the history
  • Loading branch information
tannewt committed Dec 23, 2021
1 parent 3e13d4f commit 827ad32
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ports/raspberrypi/common-hal/nvm/ByteArray.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ static void erase_and_write_sector(uint32_t address, uint32_t len, uint8_t *byte
// Write a whole sector to flash, buffering it first and then erasing and rewriting it
// since we can only erase a whole sector at a time.
uint8_t buffer[FLASH_SECTOR_SIZE];
#pragma GCC diagnostic push
#if __GNUC__ >= 11
// TODO: Update this to a better workaround for GCC 11 when one is provided.
// See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c20
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#pragma GCC diagnostic ignored "-Wstringop-overread"
#endif
memcpy(buffer, (uint8_t *)CIRCUITPY_INTERNAL_NVM_START_ADDR, FLASH_SECTOR_SIZE);
#pragma GCC diagnostic pop
memcpy(buffer + address, bytes, len);
Expand Down

0 comments on commit 827ad32

Please sign in to comment.