From 45e600f71ce5eb40695af29f93aacbf47f6f4851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 7 Aug 2016 15:37:06 +0200 Subject: [PATCH 1/2] Only warn about XML 1 if XML output is desired. --- cli/cmdlineparser.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index 39ec29cf7..3036d4543 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -747,11 +747,13 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[]) PrintMessage("cppcheck: unusedFunction check can't be used with '-j' option. Disabling unusedFunction check."); } - // Warn about XML format 1, which will be removed in cppcheck 1.81 - if (_settings->xml_version == 1U) - PrintMessage("cppcheck: XML format version 1 is deprecated and will be removed in cppcheck 1.81. Use '--xml-version=2'."); - if (_settings->inconclusive && _settings->xml && _settings->xml_version == 1U) - PrintMessage("cppcheck: inconclusive messages will not be shown, because the old xml format is not compatible."); + if (_settings->xml) { + // Warn about XML format 1, which will be removed in cppcheck 1.81 + if (_settings->xml_version == 1U) + PrintMessage("cppcheck: XML format version 1 is deprecated and will be removed in cppcheck 1.81. Use '--xml-version=2'."); + if (_settings->inconclusive && _settings->xml_version == 1U) + PrintMessage("cppcheck: inconclusive messages will not be shown, because the old xml format is not compatible."); + } if (argc <= 1) { _showHelp = true; From c2ae9764124cfb745b509ede0fa980a3b7dac714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 7 Aug 2016 15:42:24 +0200 Subject: [PATCH 2/2] remove XML 1 test from htmlreports check.sh --- htmlreport/check.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htmlreport/check.sh b/htmlreport/check.sh index e9bf6e314..bff1e2ac8 100755 --- a/htmlreport/check.sh +++ b/htmlreport/check.sh @@ -17,11 +17,6 @@ xmllint --noout gui_test.xml echo -e "\n" -../cppcheck --errorlist > errorlist.xml -xmllint --noout errorlist.xml -./cppcheck-htmlreport --file ./errorlist.xml --title "errorlist" --report-dir . -echo "" - ../cppcheck --errorlist --inconclusive --xml-version=2 > errorlist.xml xmllint --noout errorlist.xml ./cppcheck-htmlreport --file ./errorlist.xml --title "errorlist" --report-dir .