Fixed #4851 (Preprocessor: problem when using #ifndef symbol in the code)
This commit is contained in:
parent
722bfe7197
commit
15c92384f4
|
@ -202,7 +202,7 @@ unsigned int CppCheck::processFile(const std::string& filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer t("Preprocessor::getcode", _settings._showtime, &S_timerResults);
|
Timer t("Preprocessor::getcode", _settings._showtime, &S_timerResults);
|
||||||
const std::string codeWithoutCfg = preprocessor.getcode(filedata, cfg, filename, _settings._maxConfigs == 1U);
|
const std::string codeWithoutCfg = preprocessor.getcode(filedata, cfg, filename, _settings.isEnabled("information"));
|
||||||
t.Stop();
|
t.Stop();
|
||||||
|
|
||||||
const std::string &appendCode = _settings.append();
|
const std::string &appendCode = _settings.append();
|
||||||
|
|
|
@ -2758,7 +2758,7 @@ void Preprocessor::validateCfgError(const std::string &cfg, const std::string &m
|
||||||
loc.line = 1;
|
loc.line = 1;
|
||||||
loc.setfile(file0);
|
loc.setfile(file0);
|
||||||
locationList.push_back(loc);
|
locationList.push_back(loc);
|
||||||
ErrorLogger::ErrorMessage errmsg(locationList, Severity::information, "Skipping configuration '" + cfg + "' since the value of '" + macro + "' is unknown. Use -D if you want to check it.", id, false);
|
ErrorLogger::ErrorMessage errmsg(locationList, Severity::information, "Skipping configuration '" + cfg + "' since the value of '" + macro + "' is unknown. Use -D if you want to check it. You can use -U to skip it explictly.", id, false);
|
||||||
_errorLogger->reportInfo(errmsg);
|
_errorLogger->reportInfo(errmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3792,7 +3792,7 @@ private:
|
||||||
settings.addEnabled("all");
|
settings.addEnabled("all");
|
||||||
preprocessor.setFile0("test.c");
|
preprocessor.setFile0("test.c");
|
||||||
ASSERT_EQUALS(false, preprocessor.validateCfg("int a=A;", "A"));
|
ASSERT_EQUALS(false, preprocessor.validateCfg("int a=A;", "A"));
|
||||||
ASSERT_EQUALS("[test.c:1]: (information) Skipping configuration 'A' since the value of 'A' is unknown. Use -D if you want to check it.\n", errout.str());
|
ASSERT_EQUALS("[test.c:1]: (information) Skipping configuration 'A' since the value of 'A' is unknown. Use -D if you want to check it. You can use -U to skip it explictly.\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void if_sizeof() { // #4071
|
void if_sizeof() { // #4071
|
||||||
|
|
Loading…
Reference in New Issue