-
Notifications
You must be signed in to change notification settings - Fork 512
[FIX] Silence unused-but-set variable warning in zvbi decoder #1928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
cfsmp3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's unused why not just remove it?
Clean up is fine, but just hiding warnings by adding unexplainable code is not a good idea :-)
Thanks for pointing this out. I initially considered removing the variable, but it is still required for the assignment call (vbi3_raw_decoder_set_sampling_par(...)) where the side effect is needed, even though the returned value is not used later. I agree that removing unused code is preferable where possible — if there’s a better approach you’d recommend here (e.g., refactoring the call or handling the return value differently), I’m happy to update the patch. |
cfsmp3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of silencing the warning with (void), please remove the variable entirely:
// Remove this line:
vbi_service_set service_set;
// And change this:
service_set = vbi3_raw_decoder_set_sampling_par(rd3, (vbi_sampling_par *)rd, /* strict */ 0);
(void)service_set;
// To just:
vbi3_raw_decoder_set_sampling_par(rd3, (vbi_sampling_par *)rd, /* strict */ 0);The function is called for its side effects; there's no need to capture the return value if we're not using it.
|
Done I’ve removed the unused variable entirely and updated the call to rely only on the function’s side effects, as suggested. |
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 64ce4ac...:
Your PR breaks these cases:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 64ce4ac...:
Congratulations: Merging this PR would fix the following tests:
All tests passed completely. Check the result page for more info. |
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
{pull request content here}
This PR fixes a compiler warning (
-Wunused-but-set-variable) by explicitlymarking an intentionally unused local variable in
zvbi/decoder.c.There are no functional changes.