cancel
Showing results for 
Search instead for 
Did you mean: 

Suppress compiler warnings for library files

Scott_DeltaDev
Associate II

I'd like to configure GCC to suppress warnings from library files - e.g. I don't want to see the -Wconversion warning in stm32f4xx.h, but I do want to see all warnings from source files that I write myself.  I'm using STM32CubeIDE v1.10.1 on Windows.

I think a way to do this is adding a compiler flag to the MCU GCC Compiler->Miscellaneous->Other flags in project properties.  I've tried using the flags -isystem and -I, but haven't been able to suppress the warnings.

Thoughts on how to suppress warnings from all source files inside specific folders?

I'm aware of how to do this by adding #pragma to files I want to ignore warnings in, but I don't want to modify the library files.  I don't mind adding #pragma to custom source files if that's an option (i.e. globally disable warnings, selectively enable them in specific files), but I'd prefer to use compiler flags to ignore specific folders.

0 REPLIES 0