CppCheck: Don't run preprocessor rules when --check-config is used
This commit is contained in:
parent
ab30fa34e4
commit
6b260c481c
|
@ -159,6 +159,10 @@ unsigned int CppCheck::processFile(const std::string& filename, const std::strin
|
||||||
preprocessor.preprocess(fin, filedata, configurations, filename, _settings._includePaths);
|
preprocessor.preprocess(fin, filedata, configurations, filename, _settings._includePaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_settings.checkConfiguration) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Run rules on this code
|
// Run rules on this code
|
||||||
for (std::list<Settings::Rule>::const_iterator it = _settings.rules.begin(); it != _settings.rules.end(); ++it) {
|
for (std::list<Settings::Rule>::const_iterator it = _settings.rules.begin(); it != _settings.rules.end(); ++it) {
|
||||||
if (it->tokenlist == "define") {
|
if (it->tokenlist == "define") {
|
||||||
|
@ -181,10 +185,6 @@ unsigned int CppCheck::processFile(const std::string& filename, const std::strin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_settings.checkConfiguration) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_settings.userDefines.empty() && _settings._maxConfigs==1U) {
|
if (!_settings.userDefines.empty() && _settings._maxConfigs==1U) {
|
||||||
configurations.clear();
|
configurations.clear();
|
||||||
configurations.push_back(_settings.userDefines);
|
configurations.push_back(_settings.userDefines);
|
||||||
|
|
Loading…
Reference in New Issue