I'm trying to use the libclang API to programmatically analyze a C++ project. I have clang compiling fine, and my tool is properly parsing the generated AST, but I can't figure out how to turn on/off specific warnings.
here is the relevant code snippet, I would like to enable/disable the "unused variable" warning:
clang::DiagnosticOptions mDiagnosticOptions;
mDiagnosticOptions.ShowOptionNames = 1; // prints warning, ie [-Wextra-tokens]
mDiagnosticOptions.Warnings.push_back("unused-variable"); // <----- DOESN'T WORK
// use mDiagnosticOptions further down for compile steps etc.
.
.
.