Skip to content

Commit ec4a85e

Browse files
committed
Added deprecation warning for XML format 1, which will be removed in cppcheck 1.81
1 parent 2da91e1 commit ec4a85e

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

cli/cmdlineparser.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -747,9 +747,11 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
747747
PrintMessage("cppcheck: unusedFunction check can't be used with '-j' option. Disabling unusedFunction check.");
748748
}
749749

750-
if (_settings->inconclusive && _settings->xml && _settings->xml_version == 1U) {
751-
PrintMessage("cppcheck: inconclusive messages will not be shown, because the old xml format is not compatible. It's recommended to use the new xml format (use --xml-version=2).");
752-
}
750+
// Warn about XML format 1, which will be removed in cppcheck 1.81
751+
if (_settings->xml_version == 1U)
752+
PrintMessage("cppcheck: XML format version 1 is deprecated and will be removed in cppcheck 1.81. Use '--xml-version=2'.");
753+
if (_settings->inconclusive && _settings->xml && _settings->xml_version == 1U)
754+
PrintMessage("cppcheck: inconclusive messages will not be shown, because the old xml format is not compatible.");
753755

754756
if (argc <= 1) {
755757
_showHelp = true;

gui/mainwindow.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,9 @@ void MainWindow::Save()
10641064
if (!selectedFile.isEmpty()) {
10651065
Report::Type type = Report::TXT;
10661066
if (selectedFilter == tr("XML files version 1 (*.xml)")) {
1067+
QMessageBox msgBox(QMessageBox::Icon::Warning, tr("Deprecated XML format"), tr("XML format 1 is deprecated and will be removed in cppcheck 1.81."), QMessageBox::StandardButton::Ok);
1068+
msgBox.exec();
1069+
10671070
type = Report::XML;
10681071
if (!selectedFile.endsWith(".xml", Qt::CaseInsensitive))
10691072
selectedFile += ".xml";

0 commit comments

Comments
 (0)