How to disable _all_ warnings for a folder in my project #891
Replies: 2 comments
-
The Inhibit all warnings (-w) compiler option should do what you require: Within CDT managed build projects, you can configure this option for a specific source folder containing your third-party code by right-clicking on the folder in the Project Explorer view and selecting Properties from the context menu. If your project also contains C++ code, you may need to set this compiler option for both the C compiler and the C++ compiler. Does this answer your question? |
Beta Was this translation helpful? Give feedback.
-
If you want to actually disable compiler warnings, as opposed to filtering them out from the Problems view, suggest you use compiler pragmas at the point of inclusion, you may want to group all problematic 3p headers into one header that disables the warnings before including them, and include that header in your code instead. #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
//add more of these as needed: #pragma GCC diagnostic ignored "-W..."
#include "3pHeaderWithWarnings.h"
#pragma GCC diagnostic pop If you simply want your warnings to not show up in the Problems View you can try to define a working set that excludes your 3p folder and have this mode selected: |
Beta Was this translation helpful? Give feedback.
-
I searched high and low for a definitive answer on this, but I could not figure out how to suppress all warnings for a specific folder in my project. I've tried:
I still have warnings listed.
The warnings I have:
This is all in third party code I have to include in my project.
Any ideas what else to try?
I'm used to having zero warnings, turning warnings to errors in my own code and having a clean working environment.
Beta Was this translation helpful? Give feedback.
All reactions