Skip to content

Commit

Permalink
refs #12348 - fixed missing parsing of markup files when a build dir …
Browse files Browse the repository at this point in the history
…is specified (#6577)

this only fixes the check which was broken back in
ea905c9.
  • Loading branch information
firewave committed Jul 20, 2024
1 parent 61f2536 commit ddf5480
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cppcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand Down

0 comments on commit ddf5480

Please sign in to comment.