I’m wondering if there’s a way to suppress warnings only from library source code. I know it’s possible to set build flags such as -w to ignore all warnings, but I want to see warnings from my own code while ignoring the spam I get from lib_deps.
Is there a way to do this without forking all my libraries and fixing their warnings?
I’d love to know if there is also, but I suspect the answer is fix the libraries. The root issue being the Arduino IDE used to hide most of these warnings, so the library writers never saw them, so didn’t fix them (or make them! ) in the first place.
Ah, if only library maintainers would respond to my pull requests. I’ve tried this before, with only a few polite folks bothering to respond, and even fewer kind souls taking the time to review and merge my changes.
In an ideal world, I agree this would be the best option.
When you run a verbose build (pio run -v, previos pio run -t clean of course), with what flags is the GCC/G++ compiler invoked when compiling library source files which throw a warning? Are these not un-settable via build_unflags?
Thank you @maxgerhardt! I’m new in platformio. I checked verbose output and the problem is: libs includes headers also contain warnings. It seems to in that case #pragma GCC diagnostic is the solution. Oooh, Arduino world
I couldn’t get this to work.; I get “conflicting declarations” errors. I tried several modifications to this script:
Also excluding PROJECT_SRC_DIR.
Removing the paths that get added to CXXFLAGS from CPPPATH, because otherwise the -I flags for those paths are still generated in addition to the custom -isystem flags.
Changing INCPREFIX to -isystem, removing PROJECT_XXX_DIR from CPPATH, and adding -I flags to CXXFLAGS only for PROJECT_XXX_DIR.
It is unhappy unless everything uses -I or everything uses -isystem.