Skip to content

Linux: Fix compiler warnings about function pointer comparisons and make linux build warning-clean#967

Open
ScottMunroMS wants to merge 5 commits intomainfrom
user/scmunro/fix-curl-call-warning
Open

Linux: Fix compiler warnings about function pointer comparisons and make linux build warning-clean#967
ScottMunroMS wants to merge 5 commits intomainfrom
user/scmunro/fix-curl-call-warning

Conversation

@ScottMunroMS
Copy link
Copy Markdown
Contributor

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!

@ScottMunroMS ScottMunroMS changed the title Linux: Fix compiler warnings about function pointer bool comparisons Linux: Fix compiler warnings about function pointer comparisons and make linux build warning-clean Apr 30, 2026
@ScottMunroMS ScottMunroMS marked this pull request as ready for review April 30, 2026 18:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 called curl_multi_poll directly when libcurl headers are >= 7.69.0.
  • Added static_assert checks intended to validate unconditional availability of the required libcurl entry points.
  • Enabled -Werror for the Linux target with a narrow warning suppression for external zlib sources, plus an additional warning suppression for the new static_assert pattern.

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).

Comment thread Build/libHttpClient.Linux/CMakeLists.txt Outdated
Comment thread Source/HTTP/Curl/CurlMulti.cpp
Comment thread Source/HTTP/Curl/CurlMulti.cpp
Comment thread Build/libHttpClient.Linux/CMakeLists.txt Outdated
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.

2 participants