build: drop superfluous STDC_HEADERS macro#22206
Closed
vszakats wants to merge 5 commits into
Closed
Conversation
STDC_HEADERSSTDC_HEADERS
There was a problem hiding this comment.
Pull request overview
This PR removes the unused STDC_HEADERS feature probe and the associated (effectively unreachable) fallback include logic, aligning CMake/config headers and source usage with curl’s existing assumption that standard C headers are available. It also updates CI config-comparison filtering to account for autotools still defining STDC_HEADERS even though curl no longer uses it.
Changes:
- Drop
STDC_HEADERSchecks/probing from CMake configuration and tests. - Remove
STDC_HEADERS-gated inclusion of the publiccurl/stdcheaders.hfromlib/curl_setup.h. - Remove
STDC_HEADERSdefines from platform config headers and ignore the autotools-only define in the CIcmp-config.plscript.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| projects/vms/config_h.com | Removes VMS config processing for STDC_HEADERS. |
| lib/curl_setup.h | Removes conditional include of <curl/stdcheaders.h> based on STDC_HEADERS. |
| lib/curl_config-cmake.h.in | Removes generated CMake config define for STDC_HEADERS. |
| lib/config-win32.h | Removes hard-coded STDC_HEADERS define. |
| lib/config-os400.h | Removes hard-coded STDC_HEADERS define and its comment block. |
| CMakeLists.txt | Stops running the internal CMake test for STDC_HEADERS. |
| CMake/win32-cache.cmake | Removes cached STDC_HEADERS value. |
| CMake/unix-cache.cmake | Removes cached STDC_HEADERS value. |
| CMake/CurlTests.c | Removes the STDC_HEADERS-guarded compile test block. |
| .github/scripts/cmp-config.pl | Ignores #define STDC_HEADERS 1 when diffing autotools vs CMake config outputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1 task
STDC_HEADERSSTDC_HEADERS
STDC_HEADERSSTDC_HEADERS macro
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.
It is traditionally defined by autotools to detect the presence of set
of standard C89 headers. autoconf 2.70 (2020-12-08) reduced the headers
covered to
stdlib.h,string.h. After 2.59d (2006-06-05) obsoletingit earlier. CMake replicated this detection, and curl included
curl/stdcheaders.hif standard headers were missing. However, suchcondition could never happen because curl sources already assume all
checked standard headers (
stdarg.h,stdlib.h,string.h) andinclude them unconditionally.
Since this is an unused feature detection and an impossible fallback
path, drop them from CMake and curl's source. autotools continues to do
the detection by default, but its result is unused after this patch.
This leaves public
curl/stdcheaders.hunused from within the codebase.Refs:
autotools-mirror/autoconf@f0c7c42
autotools-mirror/autoconf@86c213d
Follow-up to 65dae4a #22191
Follow-up to 4c5307b
Ref: ae1912c