Clang import; Bailout if clang reports error message
This commit is contained in:
parent
2f5e585e59
commit
e1543587e0
|
@ -319,10 +319,13 @@ unsigned int CppCheck::check(const std::string &path)
|
|||
{
|
||||
std::ifstream fin(clangStderr);
|
||||
while (std::getline(fin, line)) {
|
||||
if (line.find(": fatal error:") != std::string::npos) {
|
||||
std::string::size_type pos3 = line.find(": error: ");
|
||||
if (pos3 == std::string::npos)
|
||||
pos3 = line.find(": fatal error:");
|
||||
if (pos3 == std::string::npos)
|
||||
continue;
|
||||
|
||||
// file:line:column: error: ....
|
||||
const std::string::size_type pos3 = line.find(": fatal error:");
|
||||
const std::string::size_type pos2 = line.rfind(":", pos3 - 1);
|
||||
const std::string::size_type pos1 = line.rfind(":", pos2 - 1);
|
||||
|
||||
|
@ -332,7 +335,7 @@ unsigned int CppCheck::check(const std::string &path)
|
|||
const std::string filename = line.substr(0, pos1);
|
||||
const std::string linenr = line.substr(pos1+1, pos2-pos1-1);
|
||||
const std::string colnr = line.substr(pos2+1, pos3-pos2-1);
|
||||
const std::string msg = line.substr(pos3 + 15);
|
||||
const std::string msg = line.substr(line.find(":", pos3+1) + 2);
|
||||
|
||||
std::list<ErrorLogger::ErrorMessage::FileLocation> locationList;
|
||||
ErrorLogger::ErrorMessage::FileLocation loc;
|
||||
|
@ -351,7 +354,6 @@ unsigned int CppCheck::check(const std::string &path)
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//std::cout << "Checking Clang ast dump:\n" << result2.second << std::endl;
|
||||
std::istringstream ast(result2.second);
|
||||
|
|
Loading…
Reference in New Issue