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
This commit is contained in:
Adriaan de Groot 2020-10-05 14:44:13 +02:00 committed by Brad King
parent e4e85c5b2d
commit c27553afb2

View File

@ -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));