summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestBuildHandler.cxx
diff options
context:
space:
mode:
authorAdriaan de Groot <groot@kde.org>2020-10-05 12:44:13 (GMT)
committerBrad King <brad.king@kitware.com>2020-10-05 13:14:32 (GMT)
commitc27553afb2013d83b90a71ca7940643da01b20d4 (patch)
tree2f30993c0db6c1c2a8b5b3de237fbe7ec1cab006 /Source/CTest/cmCTestBuildHandler.cxx
parente4e85c5b2d666165bb5dad4e01a78ef72dcb1481 (diff)
downloadCMake-c27553afb2013d83b90a71ca7940643da01b20d4.zip
CMake-c27553afb2013d83b90a71ca7940643da01b20d4.tar.gz
CMake-c27553afb2013d83b90a71ca7940643da01b20d4.tar.bz2
cmCTestBuildHandler: Avoid uninitialized line-numbers
When commands fail, there is no line number to report; still initialize it explicitly to avoid compiler warnings. Issue: #21166
Diffstat (limited to 'Source/CTest/cmCTestBuildHandler.cxx')
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index bb700eba..103dc1e 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -901,6 +901,7 @@ int cmCTestBuildHandler::RunMakeCommand(const std::string& command,
reporter.WriteXML();
} else {
cmCTestBuildErrorWarning errorwarning;
+ errorwarning.LineNumber = 0;
errorwarning.LogLine = 1;
errorwarning.Text = cmStrCat(
"*** WARNING non-zero return value in ctest from: ", argv[0]);
@@ -925,6 +926,7 @@ int cmCTestBuildHandler::RunMakeCommand(const std::string& command,
} else if (result == cmsysProcess_State_Error) {
// If there was an error running command, report that on the dashboard.
cmCTestBuildErrorWarning errorwarning;
+ errorwarning.LineNumber = 0;
errorwarning.LogLine = 1;
errorwarning.Text =
cmStrCat("*** ERROR executing: ", cmsysProcess_GetErrorString(cp));