From 35a63262fc00c50d4de587e6a3f81e53cfc6b2a9 Mon Sep 17 00:00:00 2001 From: firewave Date: Thu, 4 Jul 2024 14:28:07 +0200 Subject: [PATCH] refs #12348 - fixed missing parsing of markup files when a build dir is specified this only fixes the check which was broken back in ea905c9a360f224d8e1d676fc3a0d70e443fa85a. --- lib/cppcheck.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 63d85b1de3b..ad8e622a4aa 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -648,7 +648,7 @@ unsigned int CppCheck::checkFile(const FileWithDetails& file, const std::string try { if (mSettings.library.markupFile(file.spath())) { - if (mUnusedFunctionsCheck && mSettings.useSingleJob() && mSettings.buildDir.empty()) { + if (mUnusedFunctionsCheck && (mSettings.useSingleJob() || !mSettings.buildDir.empty())) { // this is not a real source file - we just want to tokenize it. treat it as C anyways as the language needs to be determined. Tokenizer tokenizer(mSettings, *this); // enforce the language since markup files are special and do not adhere to the enforced language @@ -661,6 +661,7 @@ unsigned int CppCheck::checkFile(const FileWithDetails& file, const std::string tokenizer.list.createTokens(in, file.spath()); } mUnusedFunctionsCheck->parseTokens(tokenizer, mSettings); + // TODO: set analyzer information } return EXIT_SUCCESS; }