From a15108fee42bd9e0b27948d0330764c0e0ef1949 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 7 Jun 2020 12:24:15 +1000 Subject: [PATCH] HAL_ChibiOS: fixed build with our old compiler gcc 4.9 doesn't like static_assert() in C code --- libraries/AP_HAL_ChibiOS/hwdef/common/flash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c b/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c index b25153fe1a..f21dc950e1 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c +++ b/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c @@ -127,10 +127,12 @@ static const uint32_t flash_memmap[STM32_FLASH_NPAGES] = { KB(32), KB(32), KB(32 #error "Unsupported processor for flash.c" #endif +#if defined(__GNUC__) && __GNUC__ >= 6 #ifdef STORAGE_FLASH_PAGE static_assert(STORAGE_FLASH_PAGE < STM32_FLASH_NPAGES, "STORAGE_FLASH_PAGE out of range"); #endif +#endif // keep a cache of the page addresses #ifndef STM32_FLASH_FIXED_PAGE_SIZE