Skip to content

Commit de84848

Browse files
committed
fix
1 parent 51a483c commit de84848

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cli/cmdlineparser.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,8 +797,10 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
797797
}
798798

799799
// Force checking of files that have "too many" configurations
800-
else if (std::strcmp(argv[i], "-f") == 0 || std::strcmp(argv[i], "--force") == 0)
800+
else if (std::strcmp(argv[i], "-f") == 0 || std::strcmp(argv[i], "--force") == 0) {
801801
mSettings.force = true;
802+
mSettings.maxConfigsOption = Settings::maxConfigsNotAssigned;
803+
}
802804

803805
else if (std::strcmp(argv[i], "--fsigned-char") == 0)
804806
defaultSign = 's';
@@ -971,6 +973,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
971973
}
972974

973975
mSettings.maxConfigsOption = tmp;
976+
mSettings.force = false;
974977
}
975978

976979
// max ctu depth

lib/cppcheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ unsigned int CppCheck::checkInternal(const FileWithDetails& file, const std::str
11991199
}
12001200

12011201
// Skip if we already met the same simplified token list
1202-
if (!hashes.empty()) {
1202+
if (maxConfigs > 1) {
12031203
const std::size_t hash = tokenizer.list.calculateHash();
12041204
if (hashes.find(hash) != hashes.end()) {
12051205
if (mSettings.debugwarnings)

0 commit comments

Comments
 (0)