Skip to content

Conversation

@jcfaracco
Copy link
Contributor

This PR basically fixes two compilation errors in ProcDump 3.5.0. The first one is an unused variable inside the function stress_cpu, and the other error is just a malformed variable initialization.

The first report is:

gmake[2]: Leaving directory '/root/rpmbuild/BUILD/procdump-3.5.0-build/ProcDump-for-Linux-3.5.0/redhat-linux-build'
/root/rpmbuild/BUILD/procdump-3.5.0-build/ProcDump-for-Linux-3.5.0/tests/integration/ProcDumpTestApplication.c: In function ‘stress_cpu’:
/root/rpmbuild/BUILD/procdump-3.5.0-build/ProcDump-for-Linux-3.5.0/tests/integration/ProcDumpTestApplication.c:85:21: error: variable ‘work_time’ set but not used [-Werror=unused-but-set-variable]
   85 |     struct timespec work_time, sleep_time;
      |                     ^~~~~~~~~

And the second one is:

/root/rpmbuild/BUILD/procdump-3.5.0-build/ProcDump-for-Linux-3.5.0/src/Monitor.cpp:1608:51: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
 1608 |     struct TerminalState originalTerminalState = {0};
      |                                                   ^
      |                                                   {}

This `work_time` variable is not being used in the `stress_cpu`
function. It can be removed to avoid issues with the compiler.

Signed-off-by: Julio Faracco <[email protected]>
The structure TerminalState is not a pointer. So, it should be properly
initialized with a double brackets. This commit just fixes this warning
to avoid compilation failures.

Signed-off-by: Julio Faracco <[email protected]>
@jcfaracco
Copy link
Contributor Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant