Skip to content

Commit c29d0f3

Browse files
committed
fix #11824 - Option --max-configs has no effect if -D is used
1 parent e3d2d90 commit c29d0f3

22 files changed

Lines changed: 1545 additions & 1407 deletions

cli/cmdlineparser.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
379379
}
380380
}
381381

382-
bool def = false;
383-
bool maxconfigs = false;
384382
bool debug = false;
385383

386384
ImportProject::Type projectType = ImportProject::Type::NONE;
@@ -425,8 +423,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
425423
if (!mSettings.userDefines.empty())
426424
mSettings.userDefines += ";";
427425
mSettings.userDefines += define;
428-
429-
def = true;
430426
}
431427

432428
// -E
@@ -958,8 +954,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
958954
}
959955

960956
mSettings.maxConfigs = tmp;
961-
mSettings.force = false;
962-
maxconfigs = true;
963957
}
964958

965959
// max ctu depth
@@ -1140,7 +1134,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
11401134
return Result::Fail;
11411135
}
11421136

1143-
mSettings.checkAllConfigurations = false; // Can be overridden with --max-configs or --force
11441137
std::string projectFile = argv[i]+10;
11451138
projectType = project.import(projectFile, &mSettings, &mSuppressions, isCppcheckPremium());
11461139
if (projectType == ImportProject::Type::CPPCHECK_GUI) {
@@ -1557,14 +1550,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
15571550
substituteTemplateFormatStatic(mSettings.templateFormat, !mSettings.outputFile.empty());
15581551
substituteTemplateLocationStatic(mSettings.templateLocation, !mSettings.outputFile.empty());
15591552

1560-
if (mSettings.force || maxconfigs)
1561-
mSettings.checkAllConfigurations = true;
1562-
1563-
if (mSettings.force)
1564-
mSettings.maxConfigs = INT_MAX;
1565-
else if ((def || mSettings.preprocessOnly) && !maxconfigs)
1566-
mSettings.maxConfigs = 1U;
1567-
15681553
if (debug) {
15691554
mSettings.debugnormal = true;
15701555
mSettings.debugvalueflow = true;

gui/cppcheck_de.ts

Lines changed: 98 additions & 98 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)