Skip to main content
HXiao.1
Associate II
March 20, 2024
Solved

STM32CureIDE can not surpress warnings

  • March 20, 2024
  • 1 reply
  • 846 views

I integrated one open source software module into my project, but I found that there are a lot of warning about unused functions, so I tried to surpress that by adding "-Wunused-function" in CubeIDE, and found the configuration is correct by checking the subdir.mk. But the warning can still be seen in the compile result. 

I do not want to see the warning, how can that be done? 

 

Subdir.mk

arm-none-eabi-gcc "317.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DSTM32F401xE -DUSE_STM32F4XX_NUCLEO -DUSE_HAL_DRIVER -c -I../../Inc -I../../../../../../../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../../../../../../../Drivers/STM32F4xx_HAL_Driver/Inc -I../../../../../../../Drivers/BSP/STM32F4xx-Nucleo -I../../../../../../../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -Wunused-function -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Example/PLC/317.d" -MT"Example/PLC/317.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Example/317.o"

 

Compile result:

ds.h:914:13: warning: 'SM_BAS_init__' defined but not used [-Wunused-function]

Best answer by Pavel A.

-Wno-unused-function

1 reply

Pavel A.
Pavel A.Best answer
Super User
March 20, 2024

-Wno-unused-function

HXiao.1
HXiao.1Author
Associate II
March 20, 2024

Thanks, it works