-
Notifications
You must be signed in to change notification settings - Fork 516
[FIX] Fix MSVC warning C4098: void function returning a value in networking.c #1905
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
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.
Thank you for the fix! However, there's a logic issue.
The original return ccxr_xxx(); was intentional - it calls Rust and returns early so the C fallback doesn't execute. Your fix for net_check_conn is correct:
ccxr_net_check_conn();
return;But the other 3 functions are missing the return;, so both Rust AND C code will execute when Rust is enabled.
Please add return; after the Rust calls in:
connect_to_srvnet_send_headernet_send_epg
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit a9413a2...:
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 a9413a2...:
Congratulations: Merging this PR would fix the following tests:
All tests passed completely. Check the result page for more info. |
|
Thanks for the review! I've added the missing return; statements to connect_to_srv, net_send_header, and net_send_epg as requested. Ready for re-review. |
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Description
This PR fixes multiple instances of compiler warning C4098 in
src/lib_ccx/networking.c.Several functions (
connect_to_srv,net_send_header, etc.) were declared asvoidbut were attempting to return values from internal function calls.Changes
Casted the return values of the internal Rust functions to (void) to suppress MSVC warning C4098.
Removed the explicit return; statements to ensure the subsequent C implementation is correctly executed (fixing a logic error where the C fallback was being skipped).
Environment