Fixed #4851 (Preprocessor: problem when using #ifndef symbol in the code)

This commit is contained in:
Daniel Marjamäki 2013-06-15 12:08:18 +02:00
parent 722bfe7197
commit 15c92384f4
3 changed files with 3 additions and 3 deletions

View File

@ -202,7 +202,7 @@ unsigned int CppCheck::processFile(const std::string& filename)
}
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();
const std::string &appendCode = _settings.append();

View File

@ -2758,7 +2758,7 @@ void Preprocessor::validateCfgError(const std::string &cfg, const std::string &m
loc.line = 1;
loc.setfile(file0);
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);
}

View File

@ -3792,7 +3792,7 @@ private:
settings.addEnabled("all");
preprocessor.setFile0("test.c");
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