Linux: Fix compiler warnings about function pointer comparisons and make linux build warning-clean#967
Open
ScottMunroMS wants to merge 5 commits intomainfrom
Open
Linux: Fix compiler warnings about function pointer comparisons and make linux build warning-clean#967ScottMunroMS wants to merge 5 commits intomainfrom
ScottMunroMS wants to merge 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR aims to make the Linux build warning-clean by removing pointless runtime CURL_CALL(...) availability checks (that trigger function-pointer comparison warnings) and replacing them with compile-time checks, while also tightening compiler warning settings.
Changes:
- Removed runtime
CURL_CALL(curl_multi_poll)availability checks on non-GDK platforms and calledcurl_multi_polldirectly when libcurl headers are >= 7.69.0. - Added
static_assertchecks intended to validate unconditional availability of the required libcurl entry points. - Enabled
-Werrorfor the Linux target with a narrow warning suppression for external zlib sources, plus an additional warning suppression for the newstatic_assertpattern.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| Source/HTTP/Curl/CurlMulti.cpp | Replaces runtime function-pointer checks with compile-time assertions and direct curl_multi_poll/curl_multi_wait calls. |
| Build/libHttpClient.Linux/CMakeLists.txt | Enables warnings-as-errors for Linux builds and adds warning suppressions (zlib + tautological compare). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
on linux, the CURL_CALL abstraction causes warnings when used in runtime comparisons because the compiler correctly recognizes that it's (1) a dangerous pointer->bool comparison and (2) entirely pointless.
remove the extra runtime CURL_CALL checking on platforms which don't need it and add static_asserts to verify this is safe to do.
bonus, enable the linux build to make warnings errors with minor exceptions for external code.
warning-free code is safer code!