static void addConfigForPedanticWarnings(ClangDiagnosticConfigsModel &model) { ClangDiagnosticConfig config; config.setId("Builtin.Pedantic"); config.setDisplayName(QCoreApplication::translate("ClangDiagnosticConfigsModel", "Pedantic Warnings")); config.setIsReadOnly(true); config.setCommandLineOptions({QStringLiteral("-Wpedantic")}); model.appendOrUpdate(config); }
void ClangDiagnosticConfigsWidget::onDiagnosticOptionsEdited() { const QString diagnosticOptions = m_ui->diagnosticOptionsTextEdit->document()->toPlainText().trimmed(); const QStringList updatedCommandLine = diagnosticOptions.trimmed().split(QLatin1Char(' '), QString::SkipEmptyParts); ClangDiagnosticConfig updatedConfig = currentConfig(); updatedConfig.setCommandLineOptions(updatedCommandLine); m_diagnosticConfigsModel.appendOrUpdate(updatedConfig); emit customConfigsChanged(customConfigs()); }
static void addConfigForAlmostEveryWarning(ClangDiagnosticConfigsModel &model) { ClangDiagnosticConfig config; config.setId(Constants::CPP_CLANG_BUILTIN_CONFIG_ID_EVERYTHING_WITH_EXCEPTIONS); config.setDisplayName(QCoreApplication::translate("ClangDiagnosticConfigsModel", "Warnings for almost everything")); config.setIsReadOnly(true); config.setCommandLineOptions({ QStringLiteral("-Weverything"), QStringLiteral("-Wno-c++98-compat"), QStringLiteral("-Wno-c++98-compat-pedantic"), QStringLiteral("-Wno-unused-macros"), QStringLiteral("-Wno-newline-eof"), QStringLiteral("-Wno-exit-time-destructors"), QStringLiteral("-Wno-global-constructors"), QStringLiteral("-Wno-gnu-zero-variadic-macro-arguments"), QStringLiteral("-Wno-documentation"), QStringLiteral("-Wno-shadow"), QStringLiteral("-Wno-missing-prototypes"), // Not optimal for C projects. }); model.appendOrUpdate(config); }