From 15c92384f434120514cd213656e2debd8f046fbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 15 Jun 2013 12:08:18 +0200 Subject: [PATCH] Fixed #4851 (Preprocessor: problem when using #ifndef symbol in the code) --- lib/cppcheck.cpp | 2 +- lib/preprocessor.cpp | 2 +- test/testpreprocessor.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 1ec988da2..1202f7a20 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -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(); diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 00c4354a7..64b22e938 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -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); } diff --git a/test/testpreprocessor.cpp b/test/testpreprocessor.cpp index 54f96ac26..f5732b3f6 100644 --- a/test/testpreprocessor.cpp +++ b/test/testpreprocessor.cpp @@ -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