Fixed #4594 (Analyzing errors about system headers not being found)
This commit is contained in:
parent
1f04e2c228
commit
f43ea5c491
|
@ -2233,7 +2233,8 @@ void Preprocessor::missingInclude(const std::string &filename, unsigned int line
|
||||||
loc.setfile(Path::toNativeSeparators(filename));
|
loc.setfile(Path::toNativeSeparators(filename));
|
||||||
locationList.push_back(loc);
|
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);
|
msgtype, false);
|
||||||
errmsg.file0 = file0;
|
errmsg.file0 = file0;
|
||||||
_errorLogger->reportInfo(errmsg);
|
_errorLogger->reportInfo(errmsg);
|
||||||
|
@ -3037,6 +3038,7 @@ void Preprocessor::getErrorMessages(ErrorLogger *errorLogger, const Settings *se
|
||||||
{
|
{
|
||||||
Settings settings2(*settings);
|
Settings settings2(*settings);
|
||||||
Preprocessor preprocessor(&settings2, errorLogger);
|
Preprocessor preprocessor(&settings2, errorLogger);
|
||||||
|
settings2.checkConfiguration=true;
|
||||||
preprocessor.missingInclude("", 1, "", UserHeader);
|
preprocessor.missingInclude("", 1, "", UserHeader);
|
||||||
preprocessor.missingInclude("", 1, "", SystemHeader);
|
preprocessor.missingInclude("", 1, "", SystemHeader);
|
||||||
preprocessor.validateCfgError("X");
|
preprocessor.validateCfgError("X");
|
||||||
|
|
|
@ -3359,7 +3359,7 @@ private:
|
||||||
errout.str("");
|
errout.str("");
|
||||||
settings.checkConfiguration = true;
|
settings.checkConfiguration = true;
|
||||||
preprocessor.handleIncludes(code,"test.c",includePaths,defs);
|
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("");
|
errout.str("");
|
||||||
settings.nomsg.addSuppression("missingIncludeSystem");
|
settings.nomsg.addSuppression("missingIncludeSystem");
|
||||||
|
|
Loading…
Reference in New Issue