1

When I run the Syntastic syntax check on my C file I do not get warnings about unused-function.

When I run

:let g:syntastic_c_compiler_options

I get

-DUSE_STM32L476G_EVAL_REVB -DUSE_HAL_DRIVER -DSTM32L476xx -DDEBUG_CODE -I./Core/Inc -IC:/ST/STM32Cube_FW_L4_V1.13.0/Drivers/CMSIS/Device/ST/STM32L4xx/Include -IC:/ST/STM32Cube_FW_L4_V1.13.0/Drivers/STM32L4xx_HAL_Driver/Inc -IC:/ST/STM32Cube_FW_L4_V1.13.0/Drivers/BSP/Components -IC:/ST/STM32Cube_FW_L4_V1.13.0/Drivers/CMSIS/Include -IC:/ST/STM32Cube_FW_L4_V1.13.0/Drivers/BSP/Components/stmpe1600 -IC:/ST/STM32Cube_FW_L4_V1.13.0/Drivers/BSP/Components/stmpe811 -IC:/ST/STM32Cube_FW_L4_V1.13.0/Drivers/BSP/STM32L476G_EVAL -IC:/ST/STM32Cube_FW_L4_V1.13.0/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -IC:/ST/STM32Cube_FW_L4_V1.13.0/Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Inc -IC:/ST/STM32Cube_FW_L4_V1.13.0/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc -I./Drivers/STM32L4xx_HAL_Driver/Inc -I./Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I./Drivers/CMSIS/Device/ST/STM32L4xx/Include -I./Drivers/CMSIS/Include -I./FATFS/Target -I./FATFS/App -I./Application/Src -I./Application/Inc -I./Middlewares/Third_Party/FatFs/src -Wall

(notice it ends with -Wall).

When I run

:SyntasticInfo

I get

Syntastic version: 3.8.0-14 (Vim 800, Windows, GUI)
Info for filetype: c
Global mode:active
Filetype c is active
The current file will be checked automatically
Avaiable checkrs: gcc make
Currently enabled check: gcc

I know that syntastic is working because I do get other warnings, however, I do not get warning for unused-function (i.e. static int foo() {} that no one calls). When I run on the command line.

$ gcc -....(all the options mentioned above) -c myfile.c

I do see those warnings.

Hauleth
  • 22,873
  • 4
  • 61
  • 112

0 Answers0