cppcheck.cpp: Fix reserved name "stderr"
Using "stderr" as variable name results in build errors on Windows.
This commit is contained in:
parent
8d6891ac81
commit
0cf82d6d45
|
@ -255,7 +255,7 @@ unsigned int CppCheck::check(const std::string &path)
|
||||||
|
|
||||||
const std::string clang = Path::isCPP(path) ? "clang++" : "clang";
|
const std::string clang = Path::isCPP(path) ? "clang++" : "clang";
|
||||||
const std::string temp = mSettings.buildDir + "/__temp__.c";
|
const std::string temp = mSettings.buildDir + "/__temp__.c";
|
||||||
const std::string stderr = AnalyzerInformation::getAnalyzerInfoFile(mSettings.buildDir, path, "") + ".clang-stderr";
|
const std::string clangStderr = AnalyzerInformation::getAnalyzerInfoFile(mSettings.buildDir, path, "") + ".clang-stderr";
|
||||||
|
|
||||||
/* Experimental: import clang ast dump */
|
/* Experimental: import clang ast dump */
|
||||||
const std::string cmd1 = clang + " -v -fsyntax-only " + temp + " 2>&1";
|
const std::string cmd1 = clang + " -v -fsyntax-only " + temp + " 2>&1";
|
||||||
|
@ -284,7 +284,7 @@ unsigned int CppCheck::check(const std::string &path)
|
||||||
for (const std::string &i: mSettings.includePaths)
|
for (const std::string &i: mSettings.includePaths)
|
||||||
flags += "-I" + i + " ";
|
flags += "-I" + i + " ";
|
||||||
|
|
||||||
const std::string cmd = clang + " -cc1 -ast-dump " + flags + path + " 2> " + stderr;
|
const std::string cmd = clang + " -cc1 -ast-dump " + flags + path + " 2> " + clangStderr;
|
||||||
std::pair<bool, std::string> res = executeCommand(cmd);
|
std::pair<bool, std::string> res = executeCommand(cmd);
|
||||||
if (!res.first) {
|
if (!res.first) {
|
||||||
std::cerr << "Failed to execute '" + cmd + "'" << std::endl;
|
std::cerr << "Failed to execute '" + cmd + "'" << std::endl;
|
||||||
|
@ -293,7 +293,7 @@ unsigned int CppCheck::check(const std::string &path)
|
||||||
|
|
||||||
// Ensure there are not syntax errors...
|
// Ensure there are not syntax errors...
|
||||||
{
|
{
|
||||||
std::ifstream fin(stderr);
|
std::ifstream fin(clangStderr);
|
||||||
while (std::getline(fin, line)) {
|
while (std::getline(fin, line)) {
|
||||||
if (line.find(": fatal error:") != std::string::npos) {
|
if (line.find(": fatal error:") != std::string::npos) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue