From 57187ef876c1bf63c463f0080f754d9a407b21cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 27 Jun 2020 10:34:02 +0200 Subject: [PATCH] ImportProject: Read max template recursion configuration value --- lib/importproject.cpp | 2 ++ man/manual.md | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/importproject.cpp b/lib/importproject.cpp index 72f3ef75d..a6f0da1b7 100644 --- a/lib/importproject.cpp +++ b/lib/importproject.cpp @@ -1098,6 +1098,8 @@ bool ImportProject::importCppcheckGuiProject(std::istream &istr, Settings *setti temp.checkUnusedTemplates = (strcmp(node->GetText(), "true") == 0); else if (strcmp(node->Name(), CppcheckXml::MaxCtuDepthElementName) == 0) temp.maxCtuDepth = std::atoi(node->GetText()); + else if (strcmp(node->Name(), CppcheckXml::MaxTemplateRecursionElementName) == 0) + temp.maxTemplateRecursion = std::atoi(node->GetText()); else if (strcmp(node->Name(), CppcheckXml::CheckUnknownFunctionReturn) == 0) ; // TODO else if (strcmp(node->Name(), Settings::SafeChecks::XmlRootName) == 0) { diff --git a/man/manual.md b/man/manual.md index a225ba7d3..63fbe9df0 100644 --- a/man/manual.md +++ b/man/manual.md @@ -174,8 +174,11 @@ Cppcheck output: As you can see Cppcheck has instantiated `a` until `a<101>` was reached and then it bails out. -One way to make Cppcheck analysis faster is to limit the recursion with a -template specialisation. For instance: +To limit template recursion you can; + * add template specialisation + * configure cppcheck (in the GUI project file dialog) + +Example code with template specialisation: template void a()