From ddf5480b17573df3e566264deac59e3d66b52e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Sat, 20 Jul 2024 17:38:20 +0200 Subject: [PATCH] refs #12348 - fixed missing parsing of markup files when a build dir is specified (#6577) 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 80c79f7d32d..7672a96b2f9 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -657,7 +657,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 @@ -670,6 +670,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; }