Fixed #4594 (Analyzing errors about system headers not being found)

This commit is contained in:
Alexander Mai 2013-03-13 19:50:50 +01:00 committed by Daniel Marjamäki
parent 1f04e2c228
commit f43ea5c491
2 changed files with 4 additions and 2 deletions

View File

@ -2233,7 +2233,8 @@ void Preprocessor::missingInclude(const std::string &filename, unsigned int line
loc.setfile(Path::toNativeSeparators(filename));
locationList.push_back(loc);
}
ErrorLogger::ErrorMessage errmsg(locationList, Severity::information, "Include file: \"" + header + "\" not found.",
ErrorLogger::ErrorMessage errmsg(locationList, Severity::information,
(headerType==SystemHeader) ? "Include file: <" + header + "> not found." : "Include file: \"" + header + "\" not found.",
msgtype, false);
errmsg.file0 = file0;
_errorLogger->reportInfo(errmsg);
@ -3037,6 +3038,7 @@ void Preprocessor::getErrorMessages(ErrorLogger *errorLogger, const Settings *se
{
Settings settings2(*settings);
Preprocessor preprocessor(&settings2, errorLogger);
settings2.checkConfiguration=true;
preprocessor.missingInclude("", 1, "", UserHeader);
preprocessor.missingInclude("", 1, "", SystemHeader);
preprocessor.validateCfgError("X");

View File

@ -3359,7 +3359,7 @@ private:
errout.str("");
settings.checkConfiguration = true;
preprocessor.handleIncludes(code,"test.c",includePaths,defs);
ASSERT_EQUALS("[test.c:1]: (information) Include file: \"missing-include!!.h\" not found.\n", errout.str());
ASSERT_EQUALS("[test.c:1]: (information) Include file: <missing-include!!.h> not found.\n", errout.str());
errout.str("");
settings.nomsg.addSuppression("missingIncludeSystem");