CppCheck: Don't run preprocessor rules when --check-config is used

This commit is contained in:
Daniel Marjamäki 2013-08-31 18:38:52 +02:00
parent ab30fa34e4
commit 6b260c481c
1 changed files with 4 additions and 4 deletions

View File

@ -159,6 +159,10 @@ unsigned int CppCheck::processFile(const std::string& filename, const std::strin
preprocessor.preprocess(fin, filedata, configurations, filename, _settings._includePaths);
}
if (_settings.checkConfiguration) {
return 0;
}
// Run rules on this code
for (std::list<Settings::Rule>::const_iterator it = _settings.rules.begin(); it != _settings.rules.end(); ++it) {
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) {
configurations.clear();
configurations.push_back(_settings.userDefines);