1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 03:50:02 +03:00

Merge pull request #11032 from daleckystepan/gcc10

Support for GCC 11.2.1
This commit is contained in:
haslinghuis 2022-07-06 02:41:14 +02:00 committed by GitHub
commit 73934cccc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 27 additions and 29 deletions

View file

@ -240,12 +240,11 @@ CFLAGS += $(ARCH_FLAGS) \
$(addprefix -D,$(OPTIONS)) \
$(addprefix -I,$(INCLUDE_DIRS)) \
$(DEBUG_FLAGS) \
-std=gnu11 \
-Wall -Wextra -Wunsafe-loop-optimizations -Wdouble-promotion \
-std=gnu17 \
-Wall -Wextra -Werror -Wpedantic -Wunsafe-loop-optimizations -Wdouble-promotion \
-ffunction-sections \
-fdata-sections \
-fno-common \
-pedantic \
$(TEMPORARY_FLAGS) \
$(DEVICE_FLAGS) \
-D_GNU_SOURCE \
@ -255,7 +254,7 @@ CFLAGS += $(ARCH_FLAGS) \
-D'__FORKNAME__="$(FORKNAME)"' \
-D'__TARGET__="$(TARGET)"' \
-D'__REVISION__="$(REVISION)"' \
-save-temps=obj \
-pipe \
-MMD -MP \
$(EXTRA_FLAGS)

View file

@ -138,10 +138,10 @@ VPATH := $(VPATH):$(FATFS_DIR)
endif
#Flags
ARCH_FLAGS = -mthumb -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -Wdouble-promotion
ARCH_FLAGS = -mthumb -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant
ifeq ($(TARGET),$(filter $(TARGET),$(F411_TARGETS)))
DEVICE_FLAGS = -DSTM32F411xE
DEVICE_FLAGS = -DSTM32F411xE -finline-limit=20
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f411.ld
STARTUP_SRC = startup_stm32f411xe.s
else ifeq ($(TARGET),$(filter $(TARGET),$(F405_TARGETS)))

View file

@ -123,7 +123,7 @@ VPATH := $(VPATH):$(FATFS_DIR)
endif
#Flags
ARCH_FLAGS = -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fsingle-precision-constant -Wdouble-promotion
ARCH_FLAGS = -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fsingle-precision-constant
# Flags that are used in the STM32 libraries
DEVICE_FLAGS = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER

View file

@ -126,7 +126,7 @@ VPATH := $(VPATH):$(FATFS_DIR)
endif
#Flags
ARCH_FLAGS = -mthumb -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -Wdouble-promotion
ARCH_FLAGS = -mthumb -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant
DEVICE_FLAGS = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DUSE_DMA_RAM -DMAX_MPU_REGIONS=16

View file

@ -147,7 +147,7 @@ VPATH := $(VPATH):$(FATFS_DIR)
endif
#Flags
ARCH_FLAGS = -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fsingle-precision-constant -Wdouble-promotion
ARCH_FLAGS = -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fsingle-precision-constant
# Flags that are used in the STM32 libraries
DEVICE_FLAGS = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER

View file

@ -5242,7 +5242,7 @@ static void printResource(dumpFlags_t dumpMask, const char *headingStr)
for (int index = 0; index < RESOURCE_VALUE_MAX_INDEX(resourceTable[i].maxIndex); index++) {
const ioTag_t ioTag = *(ioTag_t *)((const uint8_t *)currentConfig + resourceTable[i].stride * index + resourceTable[i].offset);
ioTag_t ioTagDefault = NULL;
ioTag_t ioTagDefault = 0;
if (defaultConfig) {
ioTagDefault = *(ioTag_t *)((const uint8_t *)defaultConfig + resourceTable[i].stride * index + resourceTable[i].offset);
}

View file

@ -114,7 +114,7 @@ void * memcpy_fn ( void * destination, const void * source, size_t num ) asm("me
#endif
#if __GNUC__ > 6
#define FALLTHROUGH __attribute__ ((fallthrough))
#define FALLTHROUGH ;__attribute__ ((fallthrough))
#else
#define FALLTHROUGH do {} while(0)
#endif

View file

@ -687,7 +687,7 @@ static void bbPostInit()
for (int motorIndex = 0; motorIndex < MAX_SUPPORTED_MOTORS && motorIndex < motorCount; motorIndex++) {
if (!bbMotorConfig(bbMotors[motorIndex].io, motorIndex, motorPwmProtocol, bbMotors[motorIndex].output)) {
return NULL;
return;
}

View file

@ -1231,7 +1231,7 @@ SD_Error_t SD_GetStatus(void)
}
else
{
ErrorState = SD_CARD_ERROR;
ErrorState = SD_ERROR;
}
return ErrorState;

View file

@ -1216,7 +1216,7 @@ SD_Error_t SD_GetStatus(void)
}
else
{
ErrorState = SD_CARD_ERROR;
ErrorState = SD_ERROR;
}
return ErrorState;

View file

@ -81,7 +81,7 @@ static void uartConfigurePinSwap(uartPort_t *uartPort)
{
uartDevice_t *uartDevice = uartFindDevice(uartPort);
if (!uartDevice) {
return NULL;
return;
}
if (uartDevice->pinSwap) {

View file

@ -2141,7 +2141,7 @@ afatfsOperationStatus_e afatfs_fseek(afatfsFilePtr_t file, int32_t offset, afatf
break;
case AFATFS_SEEK_SET:
FALLTHROUGH;
break;
}
// Now we have a SEEK_SET with a positive offset. Begin by seeking to the start of the file

View file

@ -85,7 +85,7 @@ static int crsfWriteString(displayPort_t *displayPort, uint8_t col, uint8_t row,
if (row >= crsfScreen.rows || col >= crsfScreen.cols) {
return 0;
}
const size_t truncLen = MIN((int)strlen(s), crsfScreen.cols-col); // truncate at colCount
const size_t truncLen = MIN(strlen(s), (size_t)(crsfScreen.cols - col)); // truncate at colCount
char *rowStart = &crsfScreen.buffer[row * crsfScreen.cols + col];
crsfScreen.updated |= memcmp(rowStart, s, truncLen);
if (crsfScreen.updated) {

View file

@ -216,7 +216,7 @@ static int8_t STORAGE_Read (uint8_t lun,
{
UNUSED(lun);
for (int i = 0; i < blk_len; i++) {
while (sdcard_readBlock(blk_addr + i, buf + (512 * i), NULL, NULL) == 0);
while (sdcard_readBlock(blk_addr + i, buf + (512 * i), NULL, 0) == 0);
while (sdcard_poll() == 0);
}
mscSetActive();
@ -236,7 +236,7 @@ static int8_t STORAGE_Write (uint8_t lun,
{
UNUSED(lun);
for (int i = 0; i < blk_len; i++) {
while (sdcard_writeBlock(blk_addr + i, buf + (i * 512), NULL, NULL) != SDCARD_OPERATION_IN_PROGRESS) {
while (sdcard_writeBlock(blk_addr + i, buf + (i * 512), NULL, 0) != SDCARD_OPERATION_IN_PROGRESS) {
sdcard_poll();
}
while (sdcard_poll() == 0);

View file

@ -812,8 +812,6 @@ void SetSysClock(void)
/* Wait till the main PLL is used as system clock source */
while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS ) != RCC_CFGR_SWS_PLL);
{
}
#if defined(STM32F446xx)
// Always use PLLSAI to derive USB 48MHz clock.

View file

@ -57,7 +57,7 @@
#ifdef STM32F7
#define USE_ITCM_RAM
#define ITCM_RAM_OPTIMISATION "-O2"
#define ITCM_RAM_OPTIMISATION "-O2", "-freorder-blocks-algorithm=simple"
#define USE_FAST_DATA
#define USE_DSHOT
#define USE_DSHOT_BITBANG

View file

@ -499,7 +499,8 @@ COMMON_FLAGS = \
-isystem $(GTEST_DIR)/inc \
-MMD -MP \
-Wno-c99-extensions \
-Wno-reorder
-Wno-reorder \
-pipe
CC_VERSION = $(shell $(CC) -dumpversion)
CXX_VERSION = $(shell $(CXX) -dumpversion)